public List<Client> RetrieveClientByClientNameAndDomain(string clientName, string domain)
 {
     DataSet dataSet = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(this.ConnectString, "SP_RetrieveCentralConnectClientByClientNameAndDomain", clientName, domain);
     List<Client> clients = new List<Client>();
     foreach (DataRow item in dataSet.Tables[0].Rows)
     {
         Client client = new Client();
         client.ClientName = item["ClientName"] as string;
         client.Domain = item["Domain"] as string;
         client.ProductNumber = item["ProductNumber"] as string;
         client.SerialNumber = item["SerialNumber"] as string;
         client.CoreSystemModel = item["CoreSystemModel"] as string;
         client.MAC = item["MAC"] as string;
         client.OSName = item["OSName"] as string;
         client.OSVersion = item["OSVersion"] as string;
         client.IPAddress = HP.TS.Devops.Core.IPHelper.NumberToIP((int)item["IPAddress"]);
         client.CompanyName = item["CompanyName"] as string;
         client.PrimaryContact = item["PrimaryContact"] as string;
         client.SecondaryContact = item["SecondaryContact"] as string;
         client.CreateBy = item["CreateBy"] as string;
         clients.Add(client);
     }
     return clients;
 }
 public CentralConnectCode CreateClient(Client client)
 {
     //Contact
     ContactAction contactAction = new ContactAction(this.ConnectString);
     List<Contact> primaryContacts = contactAction.RetrieveContactByFullName(client.PrimaryContact);
     if (primaryContacts.Count != 1)
     {
         return CentralConnectCode.PrimaryContactNotFound;
     }
     List<Contact> secondaryContacts = contactAction.RetrieveContactByFullName(client.SecondaryContact);
     if (secondaryContacts.Count != 1)
     {
         return CentralConnectCode.SecondaryContactNotFound;
     }
     //Company
     CompanyAction companyAction = new CompanyAction(this.ConnectString);
     List<Company> companys = companyAction.RetrieveCompanyByCompanyName(client.CompanyName);
     if (companys.Count != 1)
     {
         return CentralConnectCode.CompanyNotFound;
     }
     if (Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(this.ConnectString, "SP_CreateCentralConnectClient", client.ClientName, client.Domain, client.ProductNumber, client.SerialNumber, client.CoreSystemModel, client.OSName, client.OSVersion, client.CompanyName, client.PrimaryContact, client.SecondaryContact, client.CreateBy) != 1)
     {
         return CentralConnectCode.CreateClientFail;
     }
     return CentralConnectCode.Success;
 }