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

📄 updatebranch.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 UpdateBranch : System.Web.UI.Page
    {
        BLL.Branch.ShopBll branchupdate;
        BLL.Employee.EmployeeBll employeebllshow;

        public UpdateBranch()
        {
            branchupdate = new BLL.Branch.ShopBll();
            employeebllshow = new BLL.Employee.EmployeeBll();

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!this.IsPostBack)
            {
                  //用户权限
                if (Session["employee_id"] == null)
                {
                    Response.Write ("请您登陆系统");
                }
                else 
                {
                    if (employeebllshow.UserRole(Session["role_id"].ToString(), "62") == true)
                    {
                        BindData();
                    }
                    else
                    {
                        Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
                    }
                }
            }
        }

        private void BindData()
        {
            //把分店信息显示在修改文本框里
            List<Model.Branch.ShopModel> show = branchupdate.BranchUpdateShow(int.Parse(Request.QueryString["shop_id"]));
            foreach (Model.Branch.ShopModel item in show)
            {
                this.lblBranchid.Text = item.Shop_id.ToString();
                this.txtBranchUpdateName.Text = item.Shop_name;
                this.txtBranchUpdateUnMan.Text = item.Shop_un;
                this.txtBranchUpdateAdddress.Text = item.Shop_address;
                this.txtBranchUpdateTel.Text = item.Shop_tel;
            }
        }
        //确定修改
        protected void BtnBranchUpdate_Click(object sender, EventArgs e)
        {
            branchupdate.BranchUpdate(int.Parse(this.lblBranchid.Text), this.txtBranchUpdateName.Text, this.txtBranchUpdateUnMan.Text, this.txtBranchUpdateAdddress.Text, this.txtBranchUpdateTel.Text);
            Response.Write("<script>alert('修改成功');</script>");
            Response.Redirect("SelectBranchs.aspx");
        }

        //取消
        protected void btnBranchCancel_Click(object sender, EventArgs e)
        {
            BindData();
        }

    }
}

⌨️ 快捷键说明

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