📄 lossok.aspx.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 金利来分销管理系统.Loss
{
public partial class LossOK : System.Web.UI.Page
{
BLL.Loss.lossBll lossbllshow;
BLL.Loss.loss_listBll losslistbllshow;
BLL.Employee.EmployeeBll employeebllshow;
public LossOK()
{
lossbllshow = new BLL.Loss.lossBll();
losslistbllshow = new BLL.Loss.loss_listBll();
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(), "27") == true)
{
//将未审核的损益单据的编号添加到DropDownList里
List<Model.Loss.lossModel> lossid = lossbllshow.LossSelectByOK("未通过");
foreach (var item in lossid)
{
this.ddlLoss.Items.Add(item.loss_id);
}
}
else
{
Response.Write("<script>alert('你无权查看此功能,请与管理员联系');location.href='../Aboutus.aspx'</script>");
}
}
}
}
//通过未通过审核的损益单据查询
protected void ddlStockList_SelectedIndexChanged(object sender, EventArgs e)
{
Model.Loss.lossModel mo = lossbllshow.LossSelectByID(this.ddlLoss.Text);
this.lblName.Text = mo.loss_name_id;
this.lblTime.Text = mo.loss_time.ToString();
this.lblLossShop.Text = mo.loss_shop_id.ToString ();
}
//确定审核
protected void btnSure_Click(object sender, EventArgs e)
{
if (this.ddlLoss.SelectedValue == "请选择采购单号")
{
Response.Write("<script>alert('请选择采购单号')</script>");
}
else
{
lossbllshow.LossUpdate(this.ddlLoss.Text, this.lblOKName.Text, this.rblOK.Text);
Response.Write("<script>alert('该损益单" + this.rblOK.SelectedValue + "审核')</script>");
if (this.rblOK.Text == "通过")
{
ddlLoss.Items.Remove(ddlLoss.Text);
this.ddlLoss.SelectedIndex = 0;
}
}
//清空数据
this.gvShow.DataSource = null;
this.gvShow.DataBind();
Server.Transfer("LossOK.aspx");
}
//查看详情
protected void btnLook_Click(object sender, EventArgs e)
{
if (this.ddlLoss.SelectedValue == "请选择采购单号")
{
Response.Write("<script>alert('请选择采购单号')</script>");
}
else
{
this.gvShow.DataSource = losslistbllshow.Selectloss_listByID(this.ddlLoss.Text);
this.gvShow.DataBind();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -