protected void GetContactDetailByContactID() { CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); try { tContactPersonDetail conper = new tContactPersonDetail(); conper = UCCommonFilter.GetContactPersonDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr); if (conper.Name != null) { txtName.Text = conper.Name.ToString(); } if (conper.EmailID != null) { txtEmail.Text = conper.EmailID.ToString(); } if (conper.MobileNo != null) { txtMobileNo.Text = conper.MobileNo.ToString(); } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "AddEditSearchContact", "GetContactDetailByContactID"); } finally { UCCommonFilter.Close(); } }
public static string WMSaveRequestHead(object objAdr, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); tAddress Adrs = new tAddress(); tContactPersonDetail Con = new tContactPersonDetail(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objAdr; Adrs.AddressLine1 = dictionary["AddressLine1"].ToString(); Adrs.ID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); Adrs.LastModifiedBy = profile.Personal.UserID.ToString(); Adrs.LastModifiedDate = DateTime.Now; Adrs.City = ""; UCCommonFilter.EditAddress(Adrs, profile.DBConnection._constr); Con.Name = dictionary["Name"].ToString(); Con.EmailID = dictionary["EmilID"].ToString(); Con.MobileNo = dictionary["MobileNo"].ToString(); long AdrsID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); UCCommonFilter.EditLocation(Con, AdrsID, profile.DBConnection._constr); result = "Location saved successfully"; } catch { result = "Some error occurred"; } finally { UCCommonFilter.Close(); } return(result); }
public static string WMSaveRequestHead(object objCon, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); tContactPersonDetail ConPerD = new tContactPersonDetail(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objCon; ConPerD.Name = dictionary["Name"].ToString(); ConPerD.MobileNo = dictionary["MobileNo"].ToString(); ConPerD.EmailID = dictionary["EmailID"].ToString(); long CompanyID = long.Parse(dictionary["CompanyId"].ToString()); if (State == "Edit") { ConPerD.ID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); ConPerD.LastModifiedBy = profile.Personal.UserID.ToString(); ConPerD.LastModifiedDate = DateTime.Now; UCCommonFilter.EditContactPerson(ConPerD, profile.DBConnection._constr); } else { //long DID = Convert.ToInt64(HttpContext.Current.Session["DeptID"].ToString()); // long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DID, profile.DBConnection._constr); long DID = 0; ConPerD.ReferenceID = CompanyID; ConPerD.Department = DID; ConPerD.CompanyID = CompanyID; ConPerD.Sequence = 1; ConPerD.ObjectName = "Contact"; ConPerD.CustomerHeadID = 0; ConPerD.ContactTypeID = 4; ConPerD.Active = "N"; ConPerD.CreatedBy = profile.Personal.UserID.ToString(); ConPerD.CreationDate = DateTime.Now; UCCommonFilter.AddIntotContactpersonDetail(ConPerD, profile.DBConnection._constr); } result = "Contact saved successfully"; } catch { result = "Some error occurred"; } finally { UCCommonFilter.Close(); } return(result); }