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

📄 releave.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.Collections.Generic;

namespace YXShop.Web.Admin.Orders
{
    public partial class reLeave : System.Web.UI.Page
    {
        public static string orderId = "";
        YXShop.BLL.OrderLeave bll = new YXShop.BLL.OrderLeave();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AdminID"] == null)
            {
                Response.Redirect("../index.aspx", true);
            }
            else
            {
                if (string.IsNullOrEmpty(Session["AdminID"].ToString()))
                {
                    Response.Redirect("../index.aspx", true);
                }
            }
            if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
            {
                //初始化信息(订单信息,银行信息,支付信息)
                if (!string.IsNullOrEmpty(Request.QueryString["OrderID"]))
                {

                    //bindOrderInfo(YXShop.Common.WebUtility.replaceStr(Request.QueryString["OrderID"]));
                    orderId = YXShop.Common.WebUtility.replaceStr(Request.QueryString["OrderID"]);
                    BindReLeave(orderId);
                }
                else
                {
                    Response.Redirect("leaveInfo.aspx");
                }
            }
        }

        private void BindReLeave(string orderID) 
        {
            YXShop.BLL.UserCommon ucBll = new YXShop.BLL.UserCommon();
            List<YXShop.Model.UserCommon> ucList = null;

            string str = " OrderID = '" + orderID + "'";
            List<YXShop.Model.OrderLeave> list = bll.GetList(str);
            if (list.Count == 1)
            {
                ucList = ucBll.GetListByColumn("UID", list[0].MemberID);
                string userName = "";
                if (ucList.Count == 1)
                {
                    userName = ucList[0].UserName;
                }
                Label1.Text = userName;
                Label2.Text = list[0].CreateDate.ToString();
                Label3.Text = list[0].Content;
             }
            else if (list.Count == 2) 
            {
                if (list[0].State == 1) 
                {
                    ucList = ucBll.GetListByColumn("UID", list[0].MemberID);
                    string userName = "";
                    if (ucList.Count == 1)
                    {
                        userName = ucList[0].UserName;
                    }
                    Label1.Text = userName;
                    Label2.Text = list[0].CreateDate.ToString();
                    Label3.Text = list[0].Content;
                    TextBox1.Text = list[1].Content;
                    Button1.CommandArgument = list[1].ID.ToString();
                }
                else if (list[1].State == 1) 
                {
                    ucList = ucBll.GetListByColumn("UID", list[0].MemberID);
                    string userName = "";
                    if (ucList.Count == 1)
                    {
                        userName = ucList[0].UserName;
                    }
                    Label1.Text = userName;
                    Label2.Text = list[1].CreateDate.ToString();
                    Label3.Text = list[1].Content;
                    TextBox1.Text = list[0].Content;
                    Button1.CommandArgument = list[0].ID.ToString();
                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            YXShop.Model.OrderLeave leavModel = new YXShop.Model.OrderLeave();
            if (!string.IsNullOrEmpty(Button1.CommandArgument)) 
            {
                leavModel.ID = Convert.ToInt32(Button1.CommandArgument);
            }
            leavModel.OrderID = orderId;
            leavModel.CreateDate = DateTime.Now;
            leavModel.Content = YXShop.Common.WebUtility.replaceStr(TextBox1.Text);
            //leavModel.MemberID = DBNull.Value;
            leavModel.State = 0;
            try
            {
                if (leavModel.ID != null)
                {
                    bll.Update(leavModel);
                    YXShop.Common.alert.show("回复信息已成功修改!");
                }
                else
                {
                    bll.Add(leavModel);
                    YXShop.Common.alert.show("信息回复成功!");
                }
            }
            catch { }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("leaveInfo.aspx?OrderID=" + orderId, true);
        }
    }
}

⌨️ 快捷键说明

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