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

📄 orderinfo.aspx.cs

📁 易想商城系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
            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;
        }

        #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();
        }
        #endregion
        #endregion
        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;
        }
        #region 查找发票类型

        #endregion
        
        public decimal TotalPrice = 0;
        public decimal FactPrice = 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;
        }
        
        private void bindProduct(string orderID)
        {
            List<YXShop.Model.LineItem> li = orderItem.GetListByColumn("OrderID", orderID);
            productInfo.DataSource = li;
            productInfo.DataBind();

            #region 实际价
            YXShop.BLL.Orders databo = new YXShop.BLL.Orders();
            YXShop.Model.Orders data = databo.GetId(orderID);
            FactPrice = data.FactPrice != null ? Convert.ToDecimal(data.FactPrice) : 0;
            #endregion
        }
        

        //初始化所有订单状态按钮的显示状态
        private void InitStatus(bool bl)
        {
            for (int i = 0; i < 18; i++)
            {
                Button btn = (Button)Page.Controls[0].Controls[3].Controls[3].FindControl("Button" + i);
                if (btn != null)
                {
                    btn.Enabled = bl;
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("orderModfy.aspx?OrderID=" + orderId, true);
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001005", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有确认订单的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OrderStatus", YXShop.Common.StatuEnum.OrderStatu.已经确认.GetHashCode(), orderId);
            Response.Redirect("orderInfo.aspx?OrderID=" + orderId, true);
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001006", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有取消订单确认的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OrderStatus", YXShop.Common.StatuEnum.OrderStatu.取消.GetHashCode(), orderId);
            Response.Redirect("orderInfo.aspx?OrderID=" + orderId, true);
        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001007", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有作废订单的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OrderStatus", YXShop.Common.StatuEnum.OrderStatu.已经作废.GetHashCode(), orderId);
            Response.Redirect("orderInfo.aspx?OrderID=" + orderId, true);
        }

        protected void Button5_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001008", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有暂停订单的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OrderStatus", YXShop.Common.StatuEnum.OrderStatu.暂停处理.GetHashCode(), orderId);
            Response.Redirect("orderInfo.aspx?OrderID=" + orderId, true);
        }

        protected void Button6_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001009", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有恢复订单的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OrderStatus", YXShop.Common.StatuEnum.OrderStatu.等待处理.GetHashCode(), orderId);
            Response.Redirect("orderInfo.aspx?OrderID=" + orderId, true);
        }

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

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

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

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

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

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

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

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

        protected void Button15_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001011", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有结清订单的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OrderStatus", YXShop.Common.StatuEnum.OrderStatu.已结清.GetHashCode(), orderId);
            Response.Redirect("../Succeed/SueeccdOrder.aspx?Key=订单已结清&OrderId=" + orderId + "");
        }

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

        protected void Button17_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001013", PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有确认客户签收订单的权限!", "../index.aspx");
            }
            int statu = 0;
            if (!string.IsNullOrEmpty(orderId))
                statu = bll.UpdateOrders("OgisticsStatus", YXShop.Common.StatuEnum.OgisticsStatus.已签收.GetHashCode(), orderId);
            Response.Redirect("../Succeed/SueeccdOrder.aspx?Key=订单已签收&OrderId=" + orderId + "");
        }

        protected void Button18_Click(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("006001003", PowerTree.PowerPanel.PowerType.del))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有删除订单的权限!", "../index.aspx");
            }
            //删除
            try
            {
                YXShop.Model.LineItem lItemModel = new YXShop.Model.LineItem();
                lItemModel.OrderId = orderId;
                orderItem.Delect(lItemModel);

                //YXShop.Model.Orders orderModel = new YXShop.Model.Orders();
                //orderModel.OrderId = orderId;
                bll.Delect(orderId);
            }
            catch { }
            finally
            {
                Response.Redirect("orderlist.aspx", 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 + -