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); }