Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 25th, 2013, 04:21 AM
Giovanni68 Giovanni68 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 Giovanni68 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 30 m 55 sec
Reputation Power: 0
Detecting incoming calls

Hi all,

A few month ago our developer group started to create an IVR system and now we are working on CRM. To tell the truth it is not an easy task to match all codes appropriately. We are programming in C# and using Visual Studio. It seems we have problems with creating a customer data sheet from a database. Could you provide me any sample code for it?

Thanks in advance,

Giovanni

Reply With Quote
  #2  
Old January 25th, 2013, 06:42 AM
Dr. Amit Dr. Amit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 Dr. Amit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 11 sec
Reputation Power: 0
Detecting incoming calls

Dear Giovanni,

The customer data is retrieved from the database by calling the method shown in the code below. This method is defined in the DatabaseConnection class and performs the SELECT commands needed for retrieving the proper data.

Here is the code i mentioned:

Code:
1.	public CustomerDatasheet getCustomerDatasheet(string PhoneNumber)  
2.	{  
3.	    DbDataReader reader;  
4.	    Int64 id;  
5.	    string fullName;  
6.	    List<string> phoneNumbers = new List<string>();  
7.	    SortedDictionary<DateTime, string> notes = new SortedDictionary<DateTime, 

string>();  
8.	    string sql = string.Format("SELECT c.customer_id, c.fullname, n.phone FROM 

customer c INNER JOIN number n ON c.customer_id = n.customer_id WHERE n.phone = '{0}'", 

PhoneNumber);  
9.	    reader = this.CreateDbCommand(sql).ExecuteReader();  
10.	    if (!reader.Read())  
11.	    {  
12.	        return null;  
13.	    }  
14.	    id = (Int64)reader["customer_id"];  
15.	    fullName = (string)reader["fullname"];  
16.	    while (reader.Read())  
17.	    {  
18.	        phoneNumbers.Add((string)reader["phone"]);  
19.	    }  
20.	    reader.Close();  
21.	  
22.	    reader = this.CreateDbCommand(string.Format("SELECT n.created, n.note FROM note 

n WHERE n.customer_id = {0} ORDER BY n.created ASC", id)).ExecuteReader();  
23.	    while (reader.Read())  
24.	    {  
25.	        notes.Add((DateTime)reader["created"], (string)reader["note"]);  
26.	    }  
27.	    reader.Close();  
28.	  
29.	    return new CustomerDatasheet(id, fullName, phoneNumbers, notes);  
30.	}  


If you stuck in your project again or you need more help then I recommend you to take a look at voip-sip-sdk[dot]com/p_432-voip-incoming-call-detection-voip[dot]html. (Sorry but I am not allowed to give you the link in its original form because you know, it runs against the rules of the forum.)

Regards,

Dr. Amit Kumar

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Detecting incoming calls

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap