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

📄 stockok.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 金利来分销管理系统
{
    public partial class StockOK : System.Web.UI.Page
    {
        BLL.Store.StoreBll bllshow = new BLL.Store.StoreBll();
        BLL.Stock.StockFormBll stockformbllshow;
        BLL.Stock.Stock_SetailsBll stocksetailbllshow;
        BLL.Employee.EmployeeBll employeebllshow;

        public StockOK()
        {
            stockformbllshow = new BLL.Stock.StockFormBll();
            stocksetailbllshow = new BLL.Stock.Stock_SetailsBll();
            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(), "48") == true)
                    {
                        //实例化采购单据的泛型集合(通过审核状态)
                        List<Model.Stock.Stock_SetailsModel> stockformid = stockformbllshow.StockFormSelectByOK("未通过");
                        //显示“未通过”的单号
                        foreach (var item in stockformid)
                        {
                            this.ddlStockList.Items.Add(item.stockform_id);
                        }
                    }
                    else
                    {
                        Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
                    }
                }
            }
        }

       
     
        //通过采购单据ID查询信息
        protected void ddlStockList_SelectedIndexChanged(object sender, EventArgs e)
        {
            //通过采购单号将数据保存到采购单据Model
            Model.Stock.StockFormModel mo = stockformbllshow.StockFormSelectByID(this.ddlStockList.Text);
            this.lblName.Text = mo.askemployee_ID;
            this.lblTime.Text = mo.stockform_time.ToString();
            this.lblMonery.Text = mo.stockform_tradeprice.ToString();
            this.lblStockName.Text = Session["employee_id"].ToString();
            
        }
        //“确定”按钮事件
        protected void btnSure_Click(object sender, EventArgs e)
        {
            if (this.ddlStockList.SelectedValue == "请选择采购单号")
            {
                Response.Write("<script>alert('请选择采购单号')</script>");
            }
            else
            {
                stockformbllshow.StockFormUpdate(this.ddlStockList.Text, Session["employee_id"].ToString (), this.rblOK.SelectedValue);
                Response.Write("<script>alert('该采购单" + this.rblOK.SelectedValue + "审核')</script>");

                if (this.rblOK.Text == "通过")
                {
                    ddlStockList.Items.Remove(ddlStockList.Text);
                    this.ddlStockList.SelectedIndex = 0;
                }
            }
            //清空数据
            this.gvShow.DataSource = null;
            this.gvShow.DataBind();
            Server.Transfer("StockOK.aspx");

        }
        //查看详情
        protected void btnLook_Click(object sender, EventArgs e)
        {
            if (this.ddlStockList.SelectedValue == "请选择采购单号")
            {
                Response.Write("<script>alert('请选择采购单号')</script>");
            }
            else
            {
                this.gvShow.DataSource = stocksetailbllshow.stocksetailbystockform(this.ddlStockList.Text);
                this.gvShow.DataBind();
            }
        }
    }
}

⌨️ 快捷键说明

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