⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linkmanmodfy.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using System.Collections.Generic;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Orders
{
    public partial class LinkManModfy : System.Web.UI.Page
    {
        private static string orderId = "";
        YXShop.BLL.Orders bll = new YXShop.BLL.Orders();
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Orders.LinkManModfy));
           if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
            {
                if (!string.IsNullOrEmpty(Request.QueryString["OrderID"]))
                {
                    if (!PowerTree.PowerPass.isPass("006004004", PowerTree.PowerPanel.PowerType.update)) 
                    {
                        bp = new BasePage();
                        bp.PageError("对不起,你没有修改联系人地址的权限!","../index.aspx");
                    }
                    orderId = Request.QueryString["OrderID"];
                    try
                    {
                        BindInfo(orderId);
                    }
                    catch { }
                }
            }
        }

        private void BindInfo(string orderId) 
        {
            List<YXShop.Model.Orders> orderList = bll.GetListByColumn("OrderID", orderId);
            if (orderList.Count == 1) 
            {
                Label1.Text = orderList[0].ConsigneeName;
                TextBox5.Text = orderList[0].ConsigneeRealName;
                TextBox1.Text = orderList[0].ConsigneeAddress;
                TextBox2.Text = orderList[0].ConsigneeZip;
                TextBox3.Text = orderList[0].ConsigneeTel;
                TextBox4.Text = orderList[0].ConsigneePhone;
                TextBox6.Text = orderList[0].ConsigneeFax;
            }
        }
        #region Ajax省份
        #region 省
        [AjaxPro.AjaxMethod]
        public string Provinces()
        {
            StringBuilder shtml = new StringBuilder();
            YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
            List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", 0);
            if (data.Count > 0)
            {
                shtml.Append("<select id=\"Provinces\" name=\"Provinces\" onchange=\"Province(this)\">");
                shtml.Append("<option value='' selected>--请选择--</option>");
                foreach (YXShop.Model.Provinces dr in data)
                {
                    shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
                }
                shtml.Append("</select>");
            }
            return shtml.ToString();
        }
        [AjaxPro.AjaxMethod]
        public string Provinces(string str)
        {
            StringBuilder shtml = new StringBuilder();
            YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
            List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", 0);
            if (data.Count > 0)
            {
                shtml.Append("<select id=\"Provinces\" name=\"Provinces\" onchange=\"Province(this)\">");
                int id = 0;
                if (YXShop.Common.WebUtility.isNumeric(str))
                {
                    id = Convert.ToInt32(str.Trim());
                    shtml.Append("<option value=''>--请选择--</option>");
                }
                else 
                {
                    shtml.Append("<option value='' checked>--请选择--</option>");
                }
                foreach (YXShop.Model.Provinces dr in data)
                {
                    if (id == dr.ID)
                    {
                        shtml.Append("<option value=" + dr.ID + " checked>" + dr.Province_city + "</option> ");
                    }
                    else 
                    {
                        shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
                    }
                }
                shtml.Append("</select>");
            }
            return shtml.ToString();
        }
        #endregion

        #region 城
        [AjaxPro.AjaxMethod]
        public string Provinces_City(string idstr)
        {
            StringBuilder shtml = new StringBuilder();
            YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
            List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", idstr);
            if (data.Count > 0)
            {
                shtml.Append("<select id=\"City\" name=\"City\" onchange=\"Citys(this)\">");
                shtml.Append("<option value='' selected>--请选择--</option> ");
                foreach (YXShop.Model.Provinces dr in data)
                {
                    shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
                }
                shtml.Append("</select>");
            }
            return shtml.ToString();
        }
        #endregion

        #region 区
        [AjaxPro.AjaxMethod]
        public string Provinces_Borough(string idstr)
        {
            StringBuilder shtml = new StringBuilder();
            YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
            List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", idstr);
            if (data.Count > 0)
            {
                shtml.Append("<select id=\"borough\" name=\"borough\" onchange=\"Borough(this)\">");
                foreach (YXShop.Model.Provinces dr in data)
                {
                    shtml.Append("<option value=" + dr.ID + " selected>" + dr.Province_city + "</option> ");
                }
                shtml.Append("</select>");
            }
            return shtml.ToString();
        }
        #endregion
        #endregion

        [AjaxPro.AjaxMethod]
        public string proAddr() 
        {
            string addr = "";
            List<YXShop.Model.Orders> orderList = bll.GetListByColumn("OrderID", orderId);
            if (orderList.Count > 0) 
            {
                addr = orderList[0].ConsigneeProvince;
            }
            return addr;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            YXShop.Model.Orders orderModel = new YXShop.Model.Orders();
            List<YXShop.Model.Orders> orderList = bll.GetListByColumn("OrderID", orderId);
            if (orderList != null) 
            {
                orderModel = orderList[0];
             
                orderModel.ConsigneeName = Label1.Text;
                orderModel.ConsigneeRealName = YXShop.Common.WebUtility.replaceStr(TextBox5.Text.Trim());
                orderModel.ConsigneeAddress = YXShop.Common.WebUtility.replaceStr(TextBox1.Text.Trim());
                orderModel.ConsigneeZip = YXShop.Common.WebUtility.replaceStr(TextBox2.Text.Trim());
                orderModel.ConsigneeTel = YXShop.Common.WebUtility.replaceStr(TextBox3.Text.Trim());
                orderModel.ConsigneePhone = YXShop.Common.WebUtility.replaceStr(TextBox4.Text.Trim());
                orderModel.ConsigneeFax = YXShop.Common.WebUtility.replaceStr(TextBox6.Text.Trim());
                string pro = Request.Params["pro"] != null ? Request.Params["pro"].ToString() : "";
                string cit = Request.Params["cit"] != null ? Request.Params["cit"].ToString() : "";
                string bor = Request.Params["bor"] != null ? Request.Params["bor"].ToString() : "";
                orderModel.ConsigneeProvince = pro + "," + cit + "," + bor;
                try
                {
                    bll.Amend(orderModel);
                }
                catch { }
            }
            Response.Redirect("LinkManLManager.aspx", true);
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("LinkManLManager.aspx",true);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -