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

📄 goodsbrandselect.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 金利来分销管理系统.Goods
{
    public partial class GoodsBrandSelect : System.Web.UI.Page
    {
        BLL.Goods.BrandAddBll brandbllshow;
        BLL.Goods.ProductBll productbllshow;
        BLL.Employee.EmployeeBll employeebllshow;

        public GoodsBrandSelect()
        {
            brandbllshow = new BLL.Goods.BrandAddBll();
            productbllshow = new BLL.Goods.ProductBll();
            employeebllshow = new BLL.Employee.EmployeeBll();

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                //用户权限
                if (Session["employee_id"] == null)
                {
                    Response.Write("<script>alert('请登录系统');location.href='../Enter.aspx'</script>");
                }
                else
                {
                    if (employeebllshow.UserRole(Session["role_id"].ToString(), "16") == true)
                    {
                        ShowMethod();
                    }
                    else
                    {
                        Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
                    }
                }
            }
        }
        //查询商品品牌m
        private void ShowMethod()
        {
            this.gvShow.DataSource = brandbllshow.BrandSelect();
            this.gvShow.DataBind();
        }
        //删除商品品牌
        protected void gvShow_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string Brand_id = this.gvShow.Rows[e.RowIndex].Cells[0].Text;
            if (productbllshow.SelectBrand(int.Parse(Brand_id)) == true)
            {
                Response.Write("<script>alert('该品牌已存在于库存,不能进行删除')</script>");
            }
            else
            {
                brandbllshow.BrandDelete(int.Parse(Brand_id));
                Response.Write("<script>alert('品牌已删除')</script>");
                ShowMethod();
            }
        }
        //分页
        protected void gvShow_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this.gvShow.PageIndex = e.NewPageIndex;
            ShowMethod();
        }
     
     
    }
}

⌨️ 快捷键说明

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