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

📄 salelistui.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Shop
{
    using PowerEasy.Common;
    using PowerEasy.Controls;
    using PowerEasy.Model.Shop;
    using PowerEasy.Shop;
    using PowerEasy.Web.UI;
    using System;
    using System.Collections;
    using System.Web.UI.WebControls;

    public class SaleListUI : AdminPage
    {
        protected ExtendedGridView EgvSaleList;
        private int m_CurrentPageExp;
        private decimal m_CurrentPageSubTotal;
        protected ObjectDataSource OdsSaleList;
        protected ExtendedSiteMapPath SmpNavigator;

        protected void DropCurrentPage_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.EgvSaleList.PageIndex = (sender as DropDownList).SelectedIndex;
            this.EgvSaleList.DataBind();
        }

        protected void EgvSaleList_DataBound(object sender, EventArgs e)
        {
            if (this.EgvSaleList.Rows.Count > 0)
            {
                GridViewRow footerRow = this.EgvSaleList.FooterRow;
                footerRow.CssClass = this.EgvSaleList.RowStyle.CssClass;
                ArrayList sumSubTotalAndExp = SaleList.GetSumSubTotalAndExp();
                decimal num = DataConverter.CDecimal(sumSubTotalAndExp[0]);
                int num2 = DataConverter.CLng(sumSubTotalAndExp[1]);
                while (footerRow.Cells.Count != 3)
                {
                    footerRow.Cells.RemoveAt(0);
                }
                footerRow.HorizontalAlign = HorizontalAlign.Right;
                footerRow.Cells[0].ColumnSpan = 9;
                footerRow.Cells[0].Text = "本页合计:<br />总计金额:";
                footerRow.Cells[1].Text = this.m_CurrentPageSubTotal.ToString("N2") + "<br />" + num.ToString("N2");
                footerRow.Cells[2].HorizontalAlign = HorizontalAlign.Center;
                footerRow.Cells[2].Text = this.m_CurrentPageExp.ToString() + "<br />" + num2.ToString();
            }
        }

        protected void EgvSaleList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                SaleListInfo dataItem = e.Row.DataItem as SaleListInfo;
                this.m_CurrentPageSubTotal += dataItem.SubTotal;
                this.m_CurrentPageExp += dataItem.PresentExp;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            string str = BasePage.RequestString("SearchType");
            string str2 = BasePage.RequestString("Field");
            string str3 = BasePage.RequestString("KeyWord");
            if (!string.IsNullOrEmpty(str))
            {
                switch (str)
                {
                    case "0":
                        this.SmpNavigator.AdditionalNode = "所有商品销售记录";
                        return;

                    case "1":
                        this.SmpNavigator.AdditionalNode = "今天的商品销售记录";
                        return;

                    case "2":
                        this.SmpNavigator.AdditionalNode = "本周的商品销售记录";
                        return;

                    case "3":
                        this.SmpNavigator.AdditionalNode = "本月的商品销售记录";
                        return;

                    case "4":
                        this.SmpNavigator.AdditionalNode = "指定商品的销售记录";
                        return;

                    case "10":
                        if (string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3))
                        {
                            this.SmpNavigator.AdditionalNode = "所有商品销售记录";
                            return;
                        }
                        switch (str2)
                        {
                            case "0":
                                this.SmpNavigator.AdditionalNode = "客户名称中含有“ <span style='color:#f00'>" + str3 + "</span> ”的商品销售记录";
                                return;

                            case "1":
                                this.SmpNavigator.AdditionalNode = "用户名中含有“ <span style='color:#f00'>" + str3 + "</span> ”的商品销售记录";
                                return;

                            case "2":
                                this.SmpNavigator.AdditionalNode = "商品名称中含有“ <span style='color:#f00'>" + str3 + "</span> ”的商品销售记录";
                                return;

                            case "3":
                                DateTime time;
                                this.SmpNavigator.AdditionalNode = "购买时间为 <span style='color:#f00'>" + str3 + "</span> 的商品销售记录";
                                if (!DateTime.TryParse(str3, out time))
                                {
                                    AdminPage.WriteErrMsg("不是有效的时间格式,请重新输入!");
                                }
                                return;
                        }
                        return;

                    default:
                        this.SmpNavigator.AdditionalNode = "所有商品销售记录";
                        return;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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