Пример #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");
            }
        }
Пример #2
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(); }
        }