bigcustomerreturn.aspx.cs
来自「c#三层架构项目开发的全过程」· CS 代码 · 共 94 行
CS
94 行
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 WebApplication1
{
public partial class BigCustomerReturn : System.Web.UI.Page
{
BLL.BigCustomers.bigclient_listBll bigclient_listbllshow;
BLL.BigCustomers.bigclientBll bigclientbllshow;
BLL.Employee.EmployeeBll employeebllshow;
public BigCustomerReturn()
{
bigclient_listbllshow = new BLL.BigCustomers.bigclient_listBll();
bigclientbllshow = new BLL.BigCustomers.bigclientBll();
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(), "3") == true)
{
//通过“已出库”查询采购单据表中的采购编号
List<Model.BigCustomers.bigclient_listModel> list = bigclientbllshow.bigclientSelectByOK("已出库");
foreach (var item in list)
{
this.ddlStockID.Items.Add(item.bigclient_id);
}
this.gvShow.DataSource = bigclientbllshow.bigclientSelectByOK("已出库");
this.gvShow.DataBind();
}
else
{
Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
}
}
}
}
//生成退货单
protected void btnOK_Click(object sender, EventArgs e)
{
bigclient_listbllshow.bigclientReturnUpdate(this.ddlStockID.Text, this.lblName.Text, "未通过", "1");
Response.Write("<script>alert('退货申请已提交')</script>");
//清空数据
this.gvShow.DataSource = null;
this.gvShow.DataBind();
this.btnOK.Visible = false;
}
//通过大客户销售单据查询销售明细
protected void ddlStockID_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.ddlStockID.SelectedValue == "请选择大客户销售单据编号")
{
this.gvShow.DataSource = null;
this.gvShow.DataBind();
this.btnOK.Visible = false;
}
else
{
ShowMethod();
this.btnOK.Visible = true ;
}
}
private void ShowMethod()
{
this.gvShow.DataSource = bigclient_listbllshow.bigclient_listSelectByID(this.ddlStockID.Text);
this.gvShow.DataBind();
}
//分页
protected void gvShow_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.gvShow.PageIndex = e.NewPageIndex;
ShowMethod();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?