1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.Model;
using CY.BLL.OA;
using CY.Infrastructure.Common;
using CY.Infrastructure.Query;
using CY.BLL.Sys;
using System.Data;
using CY.BLL;
namespace CY.WebForm.Pages.procurement
{
    //吴辉
    //打印出入库信息
    public partial class OutOfStorageListPrint : BasePage
    {
        OA_StaffBLL bll_OA_StaffBLL = null;
        Sys_DictionaryBLL _Sys_DictionaryBLL = null;
        OA_SuppliersBLL _OA_SuppliersBLL = null;
        OA_CommodityBLL _OA_CommodityBLL = null;
        OA_GoodsInfoBLL _OA_GoodsInfoBLL = null;
        OA_ProcurementBLL _OA_ProcurementBLL = null;
        OA_WarehouseInfoBLL _OA_WarehouseInfoBLL = null;
        OA_Procurement Procuremet = null;
        OA_SpecificationBLL _OA_SpecificationBLL = null;
        OA_OutOfStorageBLL _OA_OutOfStorageBLL = null;
        OA_BrandBLL _OA_BrandBLL = null;
        OA_PaperWeightBLL _OA_PaperWeightBLL = null;
 
        public OutOfStorageListPrint()
        {
            _OA_PaperWeightBLL = new OA_PaperWeightBLL();
            _OA_BrandBLL = new OA_BrandBLL();
            bll_OA_StaffBLL = new OA_StaffBLL();
            _OA_OutOfStorageBLL = new OA_OutOfStorageBLL();
            _OA_SpecificationBLL = new OA_SpecificationBLL();
            _OA_WarehouseInfoBLL = new OA_WarehouseInfoBLL();
            Procuremet = new OA_Procurement();
            _OA_CommodityBLL = new OA_CommodityBLL();
            _Sys_DictionaryBLL = new Sys_DictionaryBLL();
            _OA_SuppliersBLL = new OA_SuppliersBLL();
            _OA_GoodsInfoBLL = new OA_GoodsInfoBLL();
            _OA_ProcurementBLL = new OA_ProcurementBLL();
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitialData();
                // BindList();
            }
        }
 
        protected void btn_Register_Click(object sender, EventArgs e)
        {
            BindList();
        }
 
        protected void InitialData()
        {
            //仓库
            this.selWarehouseId.DataSource = _OA_WarehouseInfoBLL.getAllWarehouseInfo(CurrentUser.MemberId);
            this.selWarehouseId.DataTextField = "WarehouseName";
            this.selWarehouseId.DataValueField = "Keyid";
            this.selWarehouseId.DataBind();
            this.selWarehouseId.Items.Insert(0, new ListItem("全部", ""));
 
            //货品类别
            this.dwCommity.DataSource = _OA_CommodityBLL.SelectModelPage(CurrentUser.MemberId, "", "True");
            this.dwCommity.DataValueField = "Keyid";
            this.dwCommity.DataTextField = "CommodityName";
            this.dwCommity.DataBind();
            this.dwCommity.Items.Insert(0, new ListItem("全部", ""));
            this.dwGoodsList.Items.Insert(0, new ListItem("全部", ""));
            this.dwGoodsList.Items.Insert(0, new ListItem("全部", ""));
            this.dwPaperWeight.Items.Insert(0, new ListItem("全部", ""));
            this.dwSpecification.Items.Insert(0, new ListItem("全部", ""));
        }
 
        protected void dwCommity_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable ds = _OA_GoodsInfoBLL.SlectModleByCommity(this.dwCommity.SelectedValue, CurrentUser.MemberId);
            if (ds.Rows.Count > 0)
            {
                this.dwGoodsList.DataSource = ds;
                this.dwGoodsList.DataTextField = "GoodsName";
                this.dwGoodsList.DataValueField = "Keyid";
                this.dwGoodsList.DataBind();
                this.dwGoodsList.Items.Insert(0, new ListItem("全部", ""));
            }
            else
            {
                this.dwGoodsList.Items.Clear();
                this.dwGoodsList.Items.Insert(0, new ListItem("全部", ""));
            }
            BindList();
            // indecChage();
        }
 
        protected void dwGoodsList_SelectedIndexChanged(object sender, EventArgs e)
        {
            indecChage();
            BindList();
        }
 
        protected void indecChage()
        {
            //品牌
            DataTable dt_brand = _OA_BrandBLL.getAllBrand(CurrentUser.MemberId, this.dwCommity.SelectedValue, this.dwGoodsList.SelectedValue);
            if (dt_brand.Rows.Count > 0)
            {
                this.dwBrand.DataSource = dt_brand;
                this.dwBrand.DataTextField = "Name";
                this.dwBrand.DataValueField = "Keyid";
                this.dwBrand.DataBind();
                this.dwBrand.Items.Insert(0, new ListItem("全部", ""));
            }
            else
            {
                this.dwBrand.Items.Clear();
                this.dwBrand.Items.Insert(0, new ListItem("全部", ""));
            }
            DataTable dt_Specefiction = _OA_SpecificationBLL.getAllSpecification(CurrentUser.MemberId, this.dwCommity.SelectedValue, this.dwGoodsList.SelectedValue);
            //规格
            if (dt_Specefiction.Rows.Count > 0)
            {
                this.dwSpecification.DataSource = dt_Specefiction;
                this.dwSpecification.DataTextField = "Name";
                this.dwSpecification.DataValueField = "Keyid";
                this.dwSpecification.DataBind();
                this.dwSpecification.Items.Insert(0, new ListItem("全部", ""));
            }
            else
            {
                this.dwSpecification.Items.Clear();
                this.dwSpecification.Items.Insert(0, new ListItem("全部", ""));
            }
            DataTable dt_PaperWeight = _OA_PaperWeightBLL.getPaperWeight(CurrentUser.MemberId, this.dwCommity.SelectedValue, this.dwGoodsList.SelectedValue);
            //克重
            if (dt_PaperWeight.Rows.Count > 0)
            {
                this.dwPaperWeight.DataSource = dt_PaperWeight;
                this.dwPaperWeight.DataTextField = "Name";
                this.dwPaperWeight.DataValueField = "Keyid";
                this.dwPaperWeight.DataBind();
                this.dwPaperWeight.Items.Insert(0, new ListItem("全部", ""));
            }
        }
 
        protected void BindList()
        {
            Pagination pa = new Pagination();
            pa.PageIndex = 1;
            pa.PageSize = int.MaxValue;
            this.ReProcurentList.DataSource = _OA_OutOfStorageBLL.getModelList(pa, CurrentUser.MemberId, this.selOpretor.Value, this.selInfoType.Value, "", this.dwGoodsList.SelectedValue, this.selWarehouseId.Value, this.txtRegTimeStart.Value.ToDateTime2(), this.txtRegTimeEnd.Value.ToDateTime2(), this.dwGoodsList.SelectedValue, this.dwSpecification.SelectedValue, this.dwPaperWeight.SelectedValue, this.dwCommity.SelectedValue);
            this.ReProcurentList.DataBind();
        }
 
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
    }
}