Guest User

Untitled

a guest
Jan 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. public static List<CRMContact> getContactList(List<string> crmIds, byte[] CrmLogin)
  2.         {
  3.             StringBuilder sb = new StringBuilder();
  4.             //create an instance of the web service
  5.             ASP_CRM_DAL.ASP_CRM_DAL ws = new ASP_CRM_DAL.ASP_CRM_DAL();
  6.  
  7.             //convert the list of strings into a semi-colon separated string
  8.             for (int x = 0; x < crmIds.Count; x++)
  9.             {
  10.                 if (x == crmIds.Count - 1)
  11.                 {
  12.                     sb.Append(crmIds[x]);
  13.                 }
  14.                 else
  15.                 {
  16.                     sb.Append(crmIds[x] + ";");
  17.                 }
  18.             }
  19.  
  20.             List<CRMContact> crmContacts = new List<CRMContact>();
  21.             DataTable dt = ws.returnCRMContactInfo(sb.ToString(), CrmLogin).Tables[0];
  22.             foreach(DataRow dr in dt.Rows)
  23.             {
  24.                 crmContacts.Add(new CRMContact(dr));
  25.             }
  26.             ws.Dispose();
  27.             return crmContacts;
  28.         }
Add Comment
Please, Sign In to add comment