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

📄 sendconsinfo.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;
using System.Text;

namespace YXShop.Web.Admin.Orders
{
    public partial class sendConsInfo : System.Web.UI.Page
    {
        private static string orderId = "";// "yx201251020";
        private static decimal remiPrice = 0;
        private static decimal paymPrice = 0;
        private static decimal prepPrice = 0;
        public decimal inPrice = 0;


        YXShop.BLL.RemittanceInfo Remibll = new YXShop.BLL.RemittanceInfo();//银行支付
        YXShop.BLL.PaymentMoney paymbll = new YXShop.BLL.PaymentMoney();//现金支付
        YXShop.BLL.PrepayMoney prepbll = new YXShop.BLL.PrepayMoney();//预付款支付

        YXShop.BLL.Orders bll = new YXShop.BLL.Orders();
        YXShop.BLL.OrderInvoice bllInv = new YXShop.BLL.OrderInvoice();
        YXShop.BLL.LineItem orderItem = new YXShop.BLL.LineItem();
        YXShop.BLL.InvoiceItem invoBll = new YXShop.BLL.InvoiceItem();

        YXShop.BLL.UserInAndExp usieBll = new YXShop.BLL.UserInAndExp();

        public YXShop.Model.Orders model = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            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"]);
                    bindOrderInfo(orderId);
                    bindProduct(orderId);
                }
                else
                {
                    Response.Redirect("orderList.aspx");
                }
            }
        }
        private void bindOrderInfo(string orderID)
        {
            List<YXShop.Model.Orders> li = bll.GetListByColumn("OrderID", orderID);
            if (li.Count == 1)
            {
                model = li[0];
            }
            else
            {
                model = new YXShop.Model.Orders();

            }
            invoInfo.Text = checkInvoiceInfo(orderId);
            remark.Text = model.Remark;
            Label2.Text = model.PaymentType == 1 ? "在线支付" : "银行汇款";
            string str = string.Format(" OrderID = '{0}'", orderId);

            YXShop.Model.RemittanceInfo remiModel = Remibll.GetModel(orderId);
            YXShop.Model.PaymentMoney paymModel = paymbll.GetModel(orderId);
            YXShop.Model.PrepayMoney prepModel = prepbll.GetModel(orderId);

            remiPrice = Convert.ToDecimal(remiModel != null ? remiModel.RemittanceMoney : 0);
            paymPrice = Convert.ToDecimal(paymModel != null ? paymModel.GatheringMoney : 0);
            prepPrice = Convert.ToDecimal(prepModel != null ? prepModel.PayoutMoney : 0);

            inPrice = remiPrice + paymPrice + prepPrice;

            if (model.OgisticsStatus == YXShop.Common.StatuEnum.OgisticsStatus.已发货.GetHashCode() || model.OgisticsStatus == YXShop.Common.StatuEnum.OgisticsStatus.已签收.GetHashCode())
            {
                Button2.Enabled = false;
            }
            else 
            {
                Button2.Enabled = true;
            }

        }
        #region 发票信息
        public string checkInvoiceInfo(object obj)
        {
            StringBuilder shtml = new StringBuilder();
            YXShop.BLL.OrderInvoice datab = new YXShop.BLL.OrderInvoice();
            List<YXShop.Model.OrderInvoice> datam = datab.GetListByColumn("OrderID", obj.ToString());
            if (datam.Count > 0)
            {
                shtml.Append("发票类型:" + this.InvoiceType(Convert.ToInt32(datam[0].InvoiceType)) + "\n");
                if (datam[0].InvoiceType.ToString() == "4")
                {
                    shtml.Append("单位名称:" + datam[0].CompanyName + "\n");
                    shtml.Append("纳税人识别号:" + datam[0].TaxpayerNumber + "\n");
                    shtml.Append("注册地址:" + datam[0].RegionAddress + "\n");
                    shtml.Append("注册电话:" + datam[0].RegionTel + "\n");
                    shtml.Append("开户银行:" + datam[0].AccountBack + "\n");
                    shtml.Append("银行账户:" + datam[0].BackNumber + "\n");
                }
                else
                {
                    shtml.Append("发票抬头:" + datam[0].InvoiceRise + "\n");
                }
                shtml.Append("发票内容:" + datam[0].InvoiceContent.ToString() == "1" ? "明细" : String.Empty + "");
            }
            return shtml.ToString();
        }

        protected string InvoiceType(int id)
        {
            YXShop.BLL.InvoiceManage datab = new YXShop.BLL.InvoiceManage();
            List<YXShop.Model.InvoiceManage> datam = datab.GetAll();
            if (datam.Count > 0)
            {
                if (datam[0].IM_ID == id)
                    return datam[0].IM_Type;
            }
            return string.Empty;
        }
        #endregion

        #region 客户信息查询
        protected string UserName(int UserID)
        {
            string str = "";
            YXShop.BLL.UserCommon ucBll = new YXShop.BLL.UserCommon();
            List<YXShop.Model.UserCommon> ucList = ucBll.GetListByColumn("UID", UserID);
            if (ucList.Count > 0)
            {
                str = ucList[0].UserName;
            }
            return str;
        }
        protected string UserReal(int UserID)
        {
            string str = "";
            YXShop.BLL.MemberInfo data = new YXShop.BLL.MemberInfo();
            List<YXShop.Model.MemberInfo> dataStr = data.GetListByColumn("UID", UserID);
            if (dataStr.Count > 0)
            {
                str = dataStr[0].cTrueName;
            }
            return str;
        }
        #endregion

        #region Formant Str
        public string checkInv(string OrderId)
        {
            YXShop.BLL.OrderInvoice datab = new YXShop.BLL.OrderInvoice();
            List<YXShop.Model.OrderInvoice> data = datab.GetListByColumn("OrderID", OrderId);
            if (data.Count > 0)
            {
                return "√";
            }
            return "<span style='color:red'>×</span>";
        }
        public string checkOrderStatu(object obj)
        {
            string reStr = string.Empty;
            Type orderStatu = typeof(YXShop.Common.StatuEnum.OrderStatu);
            bool bl = YXShop.Common.WebUtility.isNumeric(obj);
            if (bl)
            {
                reStr = Enum.GetName(orderStatu, obj);
            }
            return reStr;
        }
        public string checkPaymentStatu(object obj)
        {
            string reStr = string.Empty;
            Type paymentStatu = typeof(YXShop.Common.StatuEnum.PaymentStatu);
            bool bl = YXShop.Common.WebUtility.isNumeric(obj);
            if (bl)
            {
                reStr = Enum.GetName(paymentStatu, obj);
            }
            return reStr;
        }
        public string checkOgisticsStatu(object obj)
        {
            string reStr = string.Empty;
            Type ogisticsStatu = typeof(YXShop.Common.StatuEnum.OgisticsStatus);
            bool bl = YXShop.Common.WebUtility.isNumeric(obj);
            if (bl)
            {
                reStr = Enum.GetName(ogisticsStatu, obj);
            }
            return reStr;
        }
        public string checkInvoice(string OrderId)
        {
            string reStr = string.Empty;
            YXShop.BLL.InvoiceItem databi = new YXShop.BLL.InvoiceItem();
            List<YXShop.Model.InvoiceItem> data = databi.GetListByColumn("OrderID", OrderId);
            if (data.Count > 0)
            {
                reStr = "√";

            }
            else
            {
                reStr = "<span style='color:red'>×</span>";
            }
            return reStr;
        }
        
        #endregion


        private void bindProduct(string orderID)
        {
            List<YXShop.Model.LineItem> li = orderItem.GetListByColumn("OrderID", orderID);
            productInfo.DataSource = li;
            productInfo.DataBind();
        }
        public decimal TotalPrice = 0;
        public decimal Price = 0;
        public decimal getTotalMoney(object unitPrice, object quantity, object markPrice)
        {
            decimal reDec = 0;
            if (unitPrice == null || quantity == null)
                return reDec;
            if (YXShop.Common.WebUtility.isNumeric(Convert.ToInt32(unitPrice)) && YXShop.Common.WebUtility.isNumeric(quantity))
            {
                reDec = Convert.ToDecimal(unitPrice) * Convert.ToInt32(quantity);
            }
            if (YXShop.Common.WebUtility.isNumeric(Convert.ToDecimal(markPrice)))
            {
                Price += Convert.ToDecimal(markPrice) * Convert.ToInt32(quantity);
            }
            TotalPrice += reDec;
            return reDec;
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("sendConsignment.aspx?OrderID=" + orderId, true);
        }
        #region 送货方式
        protected string Courier(int CouID)
        {
            YXShop.BLL.YXShop_Deliver datab = new YXShop.BLL.YXShop_Deliver();
            DataSet data = datab.GetAllList("D_ID=" + CouID + "");
            if (data.Tables[0].Rows.Count > 0)
            {
                return data.Tables[0].Rows[0]["D_Name"].ToString();
            }
            return string.Empty;
        }
        #endregion
    }
}

⌨️ 快捷键说明

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