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

📄 removecheck.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 System.Data;
using Model;
namespace 金利来分销管理系统.Remove
{
    public partial class RemoveCheck : System.Web.UI.Page
    {
        //实例化的BLL层
        BLL.Remove.RemoveBll bllshow;
        BLL.Store.StoreBll storeIDshow;
        BLL.Employee.EmployeeBll employeebllshow;

        List<Model.Remove.RemoveModel> show = new List<Model.Remove.RemoveModel>();
        public RemoveCheck()
        {
            bllshow = new BLL.Remove.RemoveBll();
            storeIDshow = new BLL.Store.StoreBll();
            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(), "38") == true)
                    {
                        //获得为通过审核的调拨单据放入DropDownList里
                        List<Model.Remove.RemoveModel> removeID = bllshow.SelectRemoveID();
                        foreach (var item in removeID)
                        {
                            this.ddlRemoveID.Items.Add(item.remove_id);
                        }
                        this.lblNameto.Text = Session["employee_id"].ToString();
                    }
                    else
                    {
                        Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
                    }
                }
            }
        }
        //当DropDownList选择项改变时
        protected void ddlRemoveID_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.gvshow.DataSource = null;
            this.gvshow.DataBind();
            if (this.ddlRemoveID.SelectedIndex == 0)
            {
                this.lblNamego.Text = "";
                this.lblTimego.Text = "";
                this.lblgoid.Text = "门店号";
                this.lbltoid.Text = "门店号";
            }

            //根据单据号,显示该单据部分信息
            List<Model.Remove.RemoveModel> show = bllshow.SelectRemove(this.ddlRemoveID.Text);
            foreach (var item in show)
            {
                this.lblNamego.Text = item.remove_pname;
                this.lblTimego.Text = item.remove_time.ToString();
                this.lblgoid.Text = item.remove_go;
                this.lbltoid.Text = item.remove_to;
            }
        }
       //根据单据号,显示该单据的详细信息
        protected void btnSure_Click(object sender, EventArgs e)
        {
            this.gvshow.DataSource= bllshow.SelectRemoveList(this.ddlRemoveID.Text);
            this.gvshow.DataBind();
        }
        //确定修改审核
        protected void btnok_Click(object sender, EventArgs e)
        {
            if (this.ddlRemoveID.SelectedIndex != 0)
            {
                bllshow.UpRemove(this.ddlRemoveID.Text, this.lblNameto.Text, this.txtadvice.Text, this.rblistState.SelectedValue);
                Response.Write("<script>alert('审批成功')</script>");
                if (rblistState.SelectedValue == "通过")
                {
                    this.ddlRemoveID.Items.Remove(this.ddlRemoveID.Text);
                }
                this.ddlRemoveID.SelectedIndex = 0;
            }
            else
            {
                Response.Write("<script>alert('请选择单据')</script>");
            }
        }
       
    }
}

⌨️ 快捷键说明

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