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

📄 salemanage.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 YXShop.Common;
using System.Collections.Generic;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Shop
{
    public partial class SaleManage : System.Web.UI.Page
    {
        YXShop.BLL.Orders orderBll = new YXShop.BLL.Orders();
        public PageSet ps; BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Shop.SaleManage));
            if (!PowerTree.PowerPass.isPass("003002000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }
            if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
            {
                invoBind("");
            }
        }
        private void invoBind(string whereStr)
        {
            int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
            if (pageIndex < 0)
            {
                pageIndex = 0;
            }
            if ((Request["Event"] == null) || (Request["Event"] == ""))
            {
                pageIndex = 0;
            }
            DataView datas = orderBll.GetProductInfo(whereStr).Tables[0].DefaultView;
            GridView1.DataSource = datas;

            ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
            if (ps.PageCount <= pageIndex + 1)
            {
                pageIndex = ps.PageCount - 1;
            }

            GridView1.PageSize = PageSet.PageSize;
            GridView1.PageIndex = pageIndex;
            if (datas.Count < 1)
            {
                GridView1.BackColor = System.Drawing.Color.White;
            }
            
            GridView1.DataBind();
        }

        [AjaxPro.AjaxMethod]
        public void ItemDel(int id)
        {
            //orderBll.Delete(id);
        }
        #region 客户信息查询
        protected string UserName(object UserID)
        {
            string str = "";
            if (!YXShop.Common.WebUtility.isNumeric(UserID))
            {
                return 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(object UserID)
        {
            string str = "";
            if (!YXShop.Common.WebUtility.isNumeric(UserID))
            {
                return 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
        [AjaxPro.AjaxMethod]
        public void ItemListDel(string str)
        {
            if (isNumeric(str = str.Replace(",", "")))
                ItemDel(Convert.ToInt32(str));
        }
        [AjaxPro.AjaxMethod]
        public bool isNumeric(string num)
        {
            if (num.Length == 0)
            {
                return false;
            }
            System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex("^[0-9]+$");
            return r.IsMatch(num);
        }

        public string showStatu(object objStatu)
        {
            string reStr = "";
            if (YXShop.Common.WebUtility.isNumeric(objStatu))
            {
                int statu = Convert.ToInt32(objStatu);
                Type orderstatu = typeof(YXShop.Common.StatuEnum.OrderStatu);
                foreach (int i in Enum.GetValues(orderstatu))
                {
                    if (i == statu)
                    {
                        reStr = Enum.GetName(orderstatu, i);
                        break;
                    }
                }
            }
            return reStr;
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            string wh = " OrderStatus = " + YXShop.Common.StatuEnum.OrderStatu.已结清.GetHashCode();
            invoBind(wh);
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            string wh = " OrderStatus = " + YXShop.Common.StatuEnum.OrderStatu.未结清.GetHashCode();
            invoBind(wh);

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string wh = " OrderDate >= '" + DateTime.Today + "' order by OrderDate Desc";
            invoBind(wh);
        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            DateTime now = DateTime.Now;
            int i = int.Parse("-" + now.DayOfWeek.GetHashCode());
            DateTime date = now.AddDays(i).ToLocalTime();
            string wh = " OrderDate >= '" + date + "' order by OrderDate Desc";
            invoBind(wh);
        }

        protected void Button5_Click(object sender, EventArgs e)
        {
            DateTime now = DateTime.Now;
            string wh = " OrderDate > ='" + new DateTime(now.Year, now.Month, 1) + "' order by OrderDate Desc";
            invoBind(wh);
        }
    }
}

⌨️ 快捷键说明

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