Exemple #1
0
        public static void PMSaveAddress(object AddressInfo)
        {
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                SP_GetAddressListToBindGrid_Result Address = new SP_GetAddressListToBindGrid_Result();

                if (Sequence != "" && Sequence != "0")
                {
                    Address          = AddressClient.GetAddressTempDataBySequence(Convert.ToInt64(Sequence), sessionID, TargetObject, profile.Personal.UserID.ToString(), profile.DBConnection._constr);
                    Address.Sequence = Convert.ToInt64(Sequence);
                }
                else
                {
                    Address.Sequence = 0;
                }
                Dictionary <string, object> rec = new Dictionary <string, object>();
                rec = (Dictionary <string, object>)AddressInfo;

                Address.ObjectName  = TargetObject;
                Address.ReferenceID = Convert.ToInt64(Sequence);
                Address.AddressType = "none";

                Address.AddressLine1  = rec["AddressLine1"].ToString();
                Address.AddressLine2  = rec["AddressLine2"].ToString();
                Address.AddressLine3  = rec["AddressLine3"].ToString();
                Address.RouteID       = Convert.ToInt64(rec["RouteID"].ToString());
                Address.Landmark      = rec["Landmark"].ToString();
                Address.County        = rec["County"].ToString();
                Address.State         = rec["State"].ToString();
                Address.Zone          = rec["Zone"].ToString();    //new add
                Address.SubZone       = rec["SubZone"].ToString(); //new add
                Address.City          = rec["City"].ToString();
                Address.Zipcode       = rec["Zipcode"].ToString();
                Address.PhoneNo       = rec["PhoneNo"].ToString();
                Address.FaxNo         = rec["FaxNo"].ToString();
                Address.EmailID       = rec["EmailID"].ToString();
                Address.Active        = "N";// Active Use for Is Archive
                Address.CompanyID     = profile.Personal.CompanyID;
                Address.ShipIsChecked = "false";
                Address.BillIsChecked = "false";
                Address.IsDefault     = "N";
                if (Sequence != "0" && Sequence != "")
                {
                    AddressClient.SetValuesToTempData_onChange(sessionID, profile.Personal.UserID.ToString(), TargetObject, Convert.ToInt32(Sequence), Address, profile.DBConnection._constr);
                }
                else
                {
                    AddressClient.InsertIntoTemp(Address, sessionID, profile.Personal.UserID.ToString(), TargetObject, profile.DBConnection._constr);
                }
                AddressClient.Close();
            }
            catch (System.Exception ex)
            {
                AddressClient.Close();
                Login.Profile.ErrorHandling(ex, thispage, "AddressInfo", "PMSaveAddress");
            }
        }
Exemple #2
0
        public void MoveAddressToArchive(string Ids, string IsArchive, string CurrentObjectName)
        {
            CustomProfile      profile       = CustomProfile.GetProfile();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            AddressClient.SetAddressArchive(Ids, IsArchive, Convert.ToInt64(profile.Personal.UserID).ToString(), CurrentObjectName + "_Address", sessionID, profile.DBConnection._constr);
            AddressClient.Close();
        }
Exemple #3
0
        public static void FinalSaveAddress1(ReferenceObjectName _ReferenceObjectName, long ReferenceID, string SessionID, string TargetObjectName)
        {
            CustomProfile      profile       = CustomProfile.GetProfile();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            AddressClient.FinalSaveAddress(SessionID, _ReferenceObjectName.ToString(), ReferenceID, TargetObjectName + "_Address", profile.Personal.UserID.ToString(), profile.DBConnection._constr);
            AddressClient.Close();
        }
Exemple #4
0
        public static void ClearAddress(string ObjectName, string sessionID)
        {
            CustomProfile      profile       = CustomProfile.GetProfile();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            AddressClient.ClearTempDataFromDB(sessionID, profile.Personal.UserID.ToString(), ObjectName + "_Address", profile.DBConnection._constr);
            AddressClient.Close();
        }
Exemple #5
0
        public void ClearAddress(string ObjectName)
        {
            CustomProfile      profile       = CustomProfile.GetProfile();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            hdnAddressTargetObject.Value = ObjectName;
            AddressClient.ClearTempDataFromDB(Session.SessionID, profile.Personal.UserID.ToString(), ObjectName + "_Address", profile.DBConnection._constr);
            AddressClient.Close();
        }
Exemple #6
0
        public static string PMCheckDuplicateAddress(string Address, string Country, string State, string City)
        {
            iAddressInfoClient addressinfoclient = new iAddressInfoClient();
            CustomProfile      profile           = CustomProfile.GetProfile();
            string             Result;

            Result = addressinfoclient.CheckDuplicateAddress(Address, Country, State, City, sessionID, TargetObject, profile.Personal.UserID.ToString(), profile.DBConnection._constr);
            addressinfoclient.Close();
            return(Result);
        }
Exemple #7
0
        public static List <mSubZone> PMprintSubZone(long ZoneID)
        {
            List <mSubZone>    SubZoneList   = new List <mSubZone>();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                SubZoneList = AddressClient.GetSubZoneList(ZoneID, profile.DBConnection._constr).ToList();
                return(SubZoneList);
            }
            catch (Exception ex) { return(SubZoneList); }
            finally { AddressClient.Close(); }
        }
Exemple #8
0
        public static List <mZone> PMprintZone(string Country, string State)
        {
            List <mZone>       ZoneList      = new List <mZone>();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                ZoneList = AddressClient.GetZoneList(Country, State, profile.DBConnection._constr).ToList();
                return(ZoneList);
            }
            catch (Exception ex) { return(ZoneList); }
            finally { AddressClient.Close(); }
        }
Exemple #9
0
        protected void BindAddressFromTempData()
        {
            CustomProfile      profile       = CustomProfile.GetProfile();
            iAddressInfoClient AddressClient = new iAddressInfoClient();

            if (hdnbilling.Value == "")
            {
                hdnbilling.Value = "1";
            }
            if (hdnshipping.Value == "")
            {
                hdnshipping.Value = "1";
            }
            GvAddressInfo.DataSource = AddressClient.GetAddressTempData(hdnAddressTargetObject.Value + "_Address", Convert.ToInt64(hdnbilling.Value), Convert.ToInt64(hdnshipping.Value), Session.SessionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr);
            GvAddressInfo.DataBind();
            AddressClient.Close();
        }
        public void FillAddressByObjectNameReferenceID(string SourceObjectName, long ReferenceID, string TargetObjectName)
        {
            try
            {
                if (hdnAddressTargetObject != null)
                {
                    hdnAddressTargetObject.Value = TargetObjectName;
                }
                CustomProfile      profile       = CustomProfile.GetProfile();
                iAddressInfoClient AddressClient = new iAddressInfoClient();
                List <SP_GetAddressListToBindGrid_Result> Addresslst = new List <SP_GetAddressListToBindGrid_Result>();
                if (sessionID == null)
                {
                    sessionID = Session.SessionID;
                }
                Addresslst = AddressClient.GetAddressByObjectNameReferenceID(SourceObjectName, ReferenceID, TargetObjectName + "_Address", sessionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr).ToList();
                if (GvAddressInfo != null)
                {
                    GvAddressInfo.DataSource = Addresslst;
                    GvAddressInfo.DataBind();

                    if (hdnbilling != null)
                    {
                        hdnbilling.Value = Addresslst.Where(add => add.BillIsChecked == "true").FirstOrDefault() == null ? "1" : Addresslst.Where(add => add.BillIsChecked == "true").FirstOrDefault().Sequence.ToString();
                    }
                    if (hdnshipping != null)
                    {
                        hdnshipping.Value = Addresslst.Where(add => add.ShipIsChecked == "true").FirstOrDefault() == null ? "1" : hdnshipping.Value = Addresslst.Where(add => add.ShipIsChecked == "true").FirstOrDefault().Sequence.ToString();
                    }
                }

                AddressClient.Close();
                // btnsave.Visible = false;
            }
            catch (System.Exception ex)
            {
                //Login.Profile.ErrorHandling(ex, this, "AddressInformation", "FillAddressByObjectNameReferenceID");
            }
        }
Exemple #11
0
        protected void GetRecordFromTempDataBySequenceID(string SequenceNo)
        {
            SP_GetAddressListToBindGrid_Result Address = new SP_GetAddressListToBindGrid_Result();
            iAddressInfoClient AddressClient           = new iAddressInfoClient();

            try
            {
                lblAddressFormHeader.Text = "Add New Address Info";
                if (SequenceNo != "0")
                {
                    if (sessionID == null)
                    {
                        sessionID = Session.SessionID;
                    }
                    lblAddressFormHeader.Text = "Edit Address Info";
                    CustomProfile profile = CustomProfile.GetProfile();
                    Address = AddressClient.GetAddressTempDataBySequence(Convert.ToInt64(SequenceNo), sessionID, TargetObject, profile.Personal.UserID.ToString(), profile.DBConnection._constr);

                    txtAddress1.Text = Address.AddressLine1;
                    if (Address.AddressLine2 != null)
                    {
                        txtAddress2.Text = Address.AddressLine2;
                    }
                    if (Address.AddressLine3 != null)
                    {
                        txtAddress3.Text = Address.AddressLine3;
                    }
                    if (ddlRoute.Items.Count >= 1)
                    {
                        ddlRoute.SelectedIndex = 0;
                    }
                    if (Address.RouteID != null)
                    {
                        ddlRoute.SelectedIndex = ddlRoute.Items.IndexOf(ddlRoute.Items.FindByValue(Address.RouteID.ToString()));
                    }
                    if (Address.Landmark != null)
                    {
                        txtLandMark.Text = Address.Landmark;
                    }
                    Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + Address.County + "','" + Address.State + "','" + Address.Zone + "','" + Address.SubZone + "');", true);
                    txtcity.Text = Address.City;
                    if (Address.Zipcode != null)
                    {
                        txtPostalCode.Text = Address.Zipcode;
                    }
                    if (Address.Zipcode != null)
                    {
                        txtPostalCode.Text = Address.Zipcode;
                    }
                    if (Address.PhoneNo != null)
                    {
                        txtPhone.Text = Address.PhoneNo;
                    }
                    if (Address.PhoneNo != null)
                    {
                        txtPhone.Text = Address.PhoneNo;
                    }
                    if (Address.FaxNo != null)
                    {
                        txtFax.Text = Address.FaxNo;
                    }
                    if (Address.FaxNo != null)
                    {
                        txtFax.Text = Address.FaxNo;
                    }
                    if (Address.EmailID != null)
                    {
                        txtEmailID.Text = Address.EmailID;
                    }
                    //rbtnActiveYes.Checked = true;
                    //rbtnActiveNo.Checked = false;
                    //if (Address.Active == "N") { rbtnActiveYes.Checked = false; rbtnActiveNo.Checked = true; }
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "AddressInfo.aspx.cs", "GetRecordFromTempDataBySequenceID");
            }
            finally { AddressClient.Close(); }
        }