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

📄 selectallreserve.aspx.cs

📁 c#三层架构项目开发的全过程
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;
namespace Enterprise_management
{
    public partial class SelectAllReserve : System.Web.UI.Page
    {
        BLL.Goods.ProductBll productbllshow;
        BLL.Store.StoreBll storeIDshow;
        BLL.Employee.EmployeeBll employeebllshow;

        public SelectAllReserve()
        {
            productbllshow = new BLL.Goods.ProductBll();
            storeIDshow = new BLL.Store.StoreBll();
            employeebllshow = new BLL.Employee.EmployeeBll();

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //用户权限
                if (Session["employee_id"] == null)
                {
                    Response.Write("<script>alert('请您登陆系统');location.href='../Enter.aspx'</script>");
                }
                else
                {
                    if (employeebllshow.UserRole(Session["role_id"].ToString(), "50") == true)
                    {
                        //将所有商品编号添加到DropDownList里
                        List<Model.Goods.ProductModel> productid = productbllshow.SelectProductID();
                        foreach (var item in productid)
                        {
                            this.ddlProduct.Items.Add(item.product_id);
                        }
                        //将所有分店编号添加到DropDownList
                        List<Model.Store.StoreModel> storeid = storeIDshow.SelectStoreID();
                        foreach (var item in storeid)
                        {
                            this.ddlShop.Items.Add(item.store_id.ToString());
                        }
                        //将所有商品颜色添加到DropDownList
                        List<Model.Store.StoreModel> storecolor = storeIDshow.GetProductColor();
                        foreach (var item in storecolor)
                        {
                            this.ddlColor.Items.Add(item.store_color);
                        }
                        Show();
                    }
                    else
                    {
                        Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
                    }
                }
            }
        }

        protected void btnsearch_Click(object sender, EventArgs e)
        {
            Show();
        }

        private void Show()
        {
            List<Model.Store.StoreModel> storeall = storeIDshow.SelectStoreAll();
            if (this.ddlShop.SelectedIndex != 0)
            {
                storeall = storeall.FindAll(o => o.store_id.ToString().Contains(this.ddlShop.Text));
            }
            if (this.ddlProduct.SelectedIndex != 0)
            {
                storeall = storeall.FindAll(o => o.product_id.Contains(this.ddlProduct.Text));
            }
            if (this.ddlColor.SelectedIndex != 0)
            {
                storeall = storeall.FindAll(o => o.store_color.Contains(this.ddlColor.Text));
            }
            this.gvshow.DataSource = storeall;
            this.gvshow.DataBind();
        }
    }
}

⌨️ 快捷键说明

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