?? removeinfroselect.aspx.cs
字號(hào):
?using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace 金利來(lái)分銷(xiāo)管理系統(tǒng).Remove
{
public partial class RemoveInfroSelect : System.Web.UI.Page
{
//實(shí)例化BLL
BLL.Remove.RemoveBll removebllshow;
BLL.Goods.ProductBll productbllshow;
public RemoveInfroSelect()
{
removebllshow = new BLL.Remove.RemoveBll();
productbllshow = new BLL.Goods.ProductBll();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
//實(shí)例化商品泛型集合
List<Model.Goods.ProductModel> productid = productbllshow.SelectProductID();
//查詢商品編號(hào)
foreach (var item in productid)
{
this.ddlProductID.Items.Add(item.product_id);
}
//顯示所有調(diào)撥單據(jù)
this.gvShow.DataSource = removebllshow.RemoveSetailSelectByWhere();
this.gvShow.DataBind();
}
}
//按時(shí)間查找調(diào)撥單據(jù)按鈕事件(獲取該天單據(jù))
protected void btnSele_Click(object sender, EventArgs e)
{
//清空調(diào)撥單據(jù)編號(hào)
this.ddlStockFormID.Items.Clear();
this.ddlStockFormID.Items.Add("請(qǐng)選擇單據(jù)號(hào)");
//未選擇時(shí)間時(shí)
if (this.txtTime.Text == "")
{
//‘請(qǐng)選擇時(shí)間’,lable顯示
this.lblTime.Visible = true;
}
else
{
this.lblTime.Visible = false;
//實(shí)例化采購(gòu)明細(xì)(通過(guò)時(shí)間)
List<Model.Remove.RemoveModel> stockid = removebllshow.SelectRemoveIDByTime(DateTime.Parse(this.txtTime.Text));
//查詢所有采購(gòu)單據(jù)編號(hào)
foreach (var item in stockid)
{
this.ddlStockFormID.Items.Add(item.remove_id);
}
if (ddlStockFormID.Text == "")
{
this.gvShow.DataSource = null;
this.gvShow.DataBind();
}
}
}
//查詢調(diào)撥單據(jù)信息按鈕事件(查看)
protected void btnSelect_Click(object sender, EventArgs e)
{
//實(shí)例化調(diào)撥單據(jù)泛型集合
List<Model.Remove.RemoveModel> mo = removebllshow.RemoveSetailSelectByWhere();
//按調(diào)撥單據(jù)編號(hào)查找
if (ddlStockFormID.SelectedValue != "請(qǐng)選擇單據(jù)號(hào)")
{
mo = mo.FindAll(o => o.remove_id == this.ddlStockFormID.Text.Trim());
}
//按商品編號(hào)
if (ddlProductID.SelectedIndex!=0)
{
mo = mo.FindAll(o => o.Product_id == this.ddlProductID.Text.Trim());
}
this.gvShow.DataSource = mo;
this.gvShow.DataBind();
}
//當(dāng)單據(jù)選擇項(xiàng)發(fā)生改變時(shí)
protected void ddlStockFormID_SelectedIndexChanged(object sender, EventArgs e)
{
//清空商品編號(hào)選擇項(xiàng)的值
this.ddlProductID.Items.Clear();
this.ddlProductID.Items.Add("請(qǐng)選擇商品編號(hào)");
if (this.ddlStockFormID.SelectedValue=="請(qǐng)選擇單據(jù)號(hào)")
{
//實(shí)例化商品泛型集合
List<Model.Goods.ProductModel> productid = productbllshow.SelectProductID();
//查詢商品編號(hào)
foreach (var item in productid)
{
this.ddlProductID.Items.Add(item.product_id);
}
}
else
{
//將選擇的單據(jù)里包含的不重復(fù)的商品編號(hào),添加到商品編號(hào)選擇項(xiàng)里
List<Model.Remove.RemoveModel> stockid = removebllshow.SelectRemoveListPid(this.ddlStockFormID.SelectedValue);
foreach (var item in stockid)
{
this.ddlProductID.Items.Add(item.Product_id);
}
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -