username@email.com
2025-01-17 8d51a0762a43eedada5eb15bd24180d7204e63b3
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
169
170
171
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL.OA;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
using CY.Infrastructure.Query;
using System.Data;
namespace CY.WebForm.Pages.business
{
    public partial class AgConWarehouse : BasePage
    {
        OA_BrandBLL _OA_BrandBLL = null;
        OA_CargoSpaceBLL _OA_CargoSpaceBLL = null;
        OA_CommodityBLL _OA_CommodityBLL = null;
        OA_WarehouseInfoBLL _OA_WarehouseInfoBLL = null;
        OA_SpecificationBLL _OA_SpecificationBLL = null;
        OA_InventoryBLL _OA_InventoryBLL = null;
        OA_GoodsInfoBLL _OA_GoodsInfoBLL = null;
        OA_PaperWeightBLL _OA_PaperWeightBLL = null;
         string Keyid;
        OA_CommoditySpeciAssociateBLL _OA_CommoditySpeciAssociateBLL = null;
        public AgConWarehouse()
        {
            _OA_PaperWeightBLL = new OA_PaperWeightBLL();
            _OA_GoodsInfoBLL = new OA_GoodsInfoBLL();
            _OA_CommoditySpeciAssociateBLL = new OA_CommoditySpeciAssociateBLL();
            _OA_InventoryBLL = new OA_InventoryBLL();
            _OA_WarehouseInfoBLL = new OA_WarehouseInfoBLL();
            _OA_CargoSpaceBLL = new OA_CargoSpaceBLL();
            _OA_BrandBLL = new OA_BrandBLL();
            _OA_CommodityBLL = new OA_CommodityBLL();
            _OA_SpecificationBLL = new OA_SpecificationBLL();
        }
        string CommodityValue = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["CommidityType"].ToString() == "纸张")
            {
                OA_Commodity model = _OA_CommodityBLL.getCommodityId(CurrentUser.MemberId);
                if (model != null)
                    CommodityValue = model.Keyid.ToString2();
            }
            else
            {
                OA_Commodity model = _OA_CommodityBLL.getBanCaiId(CurrentUser.MemberId);
                if (model != null)
                    CommodityValue = model.Keyid.ToString2();
            }
                
          
            UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
            if (!IsPostBack)
            {
                ///货品名称
                DataTable ds = _OA_GoodsInfoBLL.SlectModleByCommity(CommodityValue,CurrentUser.MemberId);
                if (ds.Rows.Count > 0)
                {
                    dwGoodsList.DataSource = ds;
                    dwGoodsList.DataTextField = "GoodsName";
                    dwGoodsList.DataValueField = "Keyid";
                    dwGoodsList.DataBind();
                    dwGoodsList.Items.Insert(0, new ListItem("请选择", ""));
                }
                else
                {
                    dwGoodsList.Items.Clear();
                    dwGoodsList.Items.Insert(0, new ListItem("请选择", ""));
                }
 
                this.selWarehouseId.DataSource = _OA_WarehouseInfoBLL.getAllWarehouseInfo(CurrentUser.MemberId);
                this.selWarehouseId.DataValueField = "Keyid";
                this.selWarehouseId.DataTextField = "WarehouseName";
                this.selWarehouseId.DataBind();
                selWarehouseId.Items.Insert(0, new ListItem("请选择", ""));
                indecChage();
                BindList();
            }
        }
        /// <summary>
        /// 根据产品名初始化数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void dwGoodsList_SelectedIndexChanged(object sender, EventArgs e)
        {
            indecChage();
        }
 
        /// <summary>
        /// 根据货品类别和货品名称选择规格和品牌
        /// </summary>
        protected void indecChage()
        {
           
            ///品牌
            DataTable dt_brand = _OA_BrandBLL.getAllBrand(CurrentUser.MemberId, this.CommodityValue, this.dwGoodsList.SelectedValue);
            if (dt_brand.Rows.Count > 0)
            {
                dwBrand.DataSource = dt_brand;
                dwBrand.DataTextField = "Name";
                dwBrand.DataValueField = "Keyid";
                dwBrand.DataBind();
                dwBrand.Items.Insert(0, new ListItem("请选择", ""));
            }
            else
            {
                dwBrand.Items.Clear();
                dwBrand.Items.Insert(0, new ListItem("请选择", ""));
            }
            DataTable dt_Specefiction = _OA_SpecificationBLL.getAllSpecification(CurrentUser.MemberId, this.CommodityValue, this.dwGoodsList.SelectedValue);
            ///规格
            if (dt_Specefiction.Rows.Count > 0)
            {
                dwSpecification.DataSource = dt_Specefiction;
                dwSpecification.DataTextField = "Name";
                dwSpecification.DataValueField = "Keyid";
                dwSpecification.DataBind();
                dwSpecification.Items.Insert(0, new ListItem("请选择", ""));
            }
            else
            {
                dwSpecification.Items.Clear();
                dwSpecification.Items.Insert(0, new ListItem("请选择", ""));
            }
            DataTable dt_PaperWeight = _OA_PaperWeightBLL.getPaperWeight(CurrentUser.MemberId, this.CommodityValue, this.dwGoodsList.SelectedValue);
            ///克重
            if (dt_PaperWeight.Rows.Count > 0)
            {
                dwPaperWeight.DataSource = dt_PaperWeight;
                dwPaperWeight.DataTextField = "Name";
                dwPaperWeight.DataValueField = "Keyid";
                dwPaperWeight.DataBind();
                dwPaperWeight.Items.Insert(0, new ListItem("请选择", ""));
            }
 
 
        }
 
 
        protected void BindList()
        {
 
            Pagination pa = new Pagination();
            pa.PageIndex = UCPager1.AspNetPager.CurrentPageIndex;
            pa.PageSize = UCPager1.AspNetPager.PageSize;
            ReInventoryList.DataSource = _OA_InventoryBLL.SelectModelList(pa, CurrentUser.MemberId, this.dwPaperWeight.SelectedValue, this.selWarehouseId.Value, this.dwSpecification.SelectedValue, this.dwBrand.SelectedValue, CommodityValue, this.dwGoodsList.SelectedValue,"",DateTime.MinValue,DateTime.MaxValue);
            ReInventoryList.DataBind();
            UCPager1.AspNetPager.RecordCount = pa.RecordCount;
 
        }
 
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
 
        protected void btn_Register_Click(object sender, EventArgs e)
        {
            BindList();
        }
       
 
       
    }
}