public void FillContactPersonByObjectNameReferenceIdLead(string SourceObjectName, long ReferenceID, string TargetObjectName)
        {
            try
            {
                if (hdnConPersonTargetObject != null)
                {
                    hdnConPersonTargetObject.Value = TargetObjectName;
                }
                CustomProfile profile = CustomProfile.GetProfile();
                BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient ServiceContactPerson = new BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient();
                List <SP_GetContactPersonListToBindGridLead_Result>            ContactPersonList    = new List <SP_GetContactPersonListToBindGridLead_Result>();

                if (sessionID == null)
                {
                    sessionID = Session.SessionID;
                }

                ContactPersonList = ServiceContactPerson.GetContactPersonByObjectNameReferenceIDLead(SourceObjectName, ReferenceID, TargetObjectName + "_ContactPerson", sessionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr).ToList();
                if (GVContactPerson != null)
                {
                    GVContactPerson.DataSource = ContactPersonList;
                    GVContactPerson.DataBind();
                }
                ServiceContactPerson.Close();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, ParentPage, "UC ContactPerson", "FillContactPersonByObjectNameReferenceID");
            }
        }
        public static void FinalSaveContactPerson1(string ObjectName, long ReferenceID, string SessionID, string TargetObjectName)
        {
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient ServiceContactPerson = new BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient();
            ServiceContactPerson.FinalSaveToDBtAddToContactPerson(SessionID, TargetObjectName + "_ContactPerson", ReferenceID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
            ServiceContactPerson.Close();
        }
        public static void ClearContactPerson(string ObjectName, string SessionID)
        {
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient ServiceContactPerson = new BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient();
            ServiceContactPerson.ClearTempDataFromDB(SessionID, profile.Personal.UserID.ToString(), ObjectName + "_ContactPerson", profile.DBConnection._constr);
            ServiceContactPerson.Close();
        }
        public void ClearContactPerson(string ObjectName)
        {
            hdnConPersonTargetObject.Value = ObjectName;
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient ServiceContactPerson = new BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient();
            ServiceContactPerson.ClearTempDataFromDB(Session.SessionID, profile.Personal.UserID.ToString(), hdnConPersonTargetObject.Value + "_ContactPerson", profile.DBConnection._constr);
            ServiceContactPerson.Close();
        }
 protected void BindContactPersonFromTempData()
 {
     try
     {
         CustomProfile profile = CustomProfile.GetProfile();
         BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient ServiceContactPerson = new BrilliantWMS.ServiceContactPersonInfo.iContactPersonInfoClient();
         if (hnddefaultchk.Value == "")
         {
             hnddefaultchk.Value = "1";
         }
         GVContactPerson.DataSource = ServiceContactPerson.GetContactPersonTempData(hdnConPersonTargetObject.Value + "_ContactPerson", Convert.ToInt64(hnddefaultchk.Value), Session.SessionID.ToString(), profile.Personal.UserID.ToString(), profile.DBConnection._constr);
         // GVContactPerson.DataSource = ServiceContactPerson.GetContactPersonTempData("_ContactPerson", Convert.ToInt64(hnddefaultchk.Value), Session.SessionID.ToString(), profile.Personal.UserID.ToString(), profile.DBConnection._constr);
         GVContactPerson.DataBind();
         ServiceContactPerson.Close();
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, ParentPage, "UC ContactPerson", "BindContactPersonFromTempData");
     }
 }