public AppCrmAccount AppGetAccountByEmail(string email) { AccountOperation ao = new AccountOperation(); AppCrmAccount account = ao.AppGetAccountByEmail(email); return(account); }
public AppCrmAccount AppGetAccountByEmail(string email) { log.Info("AppGetAccountByEmail-->:" + email); AppCrmAccount new_account = new AppCrmAccount(); try { CrmUtil cu = new CrmUtil(); OrganizationServiceProxy organizationProxy = cu.getCrmService(); Entity account = RetriveAccountByEmail(organizationProxy, email); new_account.AccName = account.GetAttributeValue <string>("name"); new_account.AccPhone = account.GetAttributeValue <string>("telephone1"); new_account.AccFax = account.GetAttributeValue <string>("fax"); new_account.AccEmail = account.GetAttributeValue <string>("emailaddress1"); new_account.AccStreet1 = account.GetAttributeValue <string>("address1_line1"); new_account.AccStreet2 = account.GetAttributeValue <string>("address1_line2"); new_account.AccCity = account.GetAttributeValue <string>("address1_city"); new_account.AccStateProvince = account.GetAttributeValue <string>("address1_stateorprovince"); new_account.AccCountryRegion = account.GetAttributeValue <string>("address1_country"); new_account.AccZIPPostalCode = account.GetAttributeValue <string>("address1_postalcode"); if (account.Contains("new_check") && account.GetAttributeValue <bool>("new_check")) { new_account.AccTradeRegistration = "true"; } else { new_account.AccTradeRegistration = "false"; } } catch (Exception ex) { log.Info(ex.Message + "--" + ex.ToString()); } return(new_account); }