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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using System.Web.Script.Serialization;
using Newtonsoft.Json.Linq;
using Model;
using DBUtility;
 
namespace DAL
{
 
    public class POInStockBillServices
    {
        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        /// <summary>
        /// 要货通知单
        /// </summary>
        /// <returns></returns>
        public DataSet GetPOInStockBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Cg_POInStockBillList ", "ClsCg_POInStockBill"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
 
                throw;
            }
        }
        /// <summary>
        /// 采购订单列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetPOOrderBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Cg_POOrderBillList ", "h_v_Cg_POOrderBillList"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
 
                throw;
            }
        }
        /// <summary>
        /// 委外订单列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetICSubContractBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Kf_EntrustInBillList ", "h_v_Kf_EntrustInBillList"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
 
                throw;
            }
        }
        /// <summary>
        /// 条码档案列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetBarCodeBill()
        {
            try
            {
                DataSet dataSet = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill ", "h_v_Gy_BarCodeBill"); //where hmaterid=" + sqlWhere
                return dataSet;
            }
            catch (Exception)
            {
 
                throw;
            }
        }
        public List<ClsCg_POInStockBill> GetLabelPrintDetail(long sqlWhere)
        {
            List<ClsCg_POInStockBill> POInStockBillList = new List<ClsCg_POInStockBill>();
            try
            {
                SqlParameter[] param = new SqlParameter[] 
                    { 
                       //new SqlParameter("@sqlWhere", sqlWhere)
                        //new SqlParameter("@JDInterID",""),
                        //new SqlParameter("@JDEntryID","")
                    };
                SqlDataReader reader = SQLHelpers.GetReaderByProcedure("ClsCg_POInStockBill", param);
 
                while (reader.Read())
                {
                    POInStockBillList.Add(new ClsCg_POInStockBill()
                    {
                        HInterID = DBUtility.ClsPub.isLong(reader["HInterID"]),
                        HEntryID = DBUtility.ClsPub.isLong(reader["HEntryID"]),
 
                        HDateForWeb = DBUtility.ClsPub.isStrNull(reader["HDateForWeb"]),
                        HAddress = DBUtility.ClsPub.isStrNull(reader["HAddress"]),//     varchar(200)                --交货地点 
                        HSupID = DBUtility.ClsPub.isLong(reader["HSupID"]),//      int                 --供应商 (Gy_Supplier)
                        HCurID = DBUtility.ClsPub.isLong(reader["HCurID"]),//    int                  --币别 (Gy_Currency)
                        HWHID = DBUtility.ClsPub.isLong(reader["HWHID"]),//      int     --仓库
                        HExRate = DBUtility.ClsPub.isLong(reader["HExRate"]),//    money                  --汇率  (选择完币别带出)
                        HEmpID = DBUtility.ClsPub.isLong(reader["HEmpID"]),//     int                   --业务员  (Gy_Employee)
                        HMangerID = DBUtility.ClsPub.isLong(reader["HMangerID"]),//  int                 --主管    (Gy_Employee)
                        HDeptID = DBUtility.ClsPub.isLong(reader["HDeptID"]),//     int                 --部门    (Gy_Employee)
                        HExplanation = DBUtility.ClsPub.isStrNull(reader["HExplanation"]),//  varchar(200)             --摘要 
                        HInnerBillNo = DBUtility.ClsPub.isStrNull(reader["HInnerBillNo"]),//  varchar(50)             --内部单据号
                        HMaterID = DBUtility.ClsPub.isLong(reader["HMaterID"]),//  int      --物料ID (Gy_Material)
                        HUnitID = DBUtility.ClsPub.isLong(reader["HUnitID"]),//    int    --计量单位 (Gy_Unit)
                        HQty = DBUtility.ClsPub.isLong(reader["HQty"]),//     dec(18,8)         --要货数量
                        HCheckQty = DBUtility.ClsPub.isLong(reader["HCheckQty"]),        //检验数
                        HPassQty = DBUtility.ClsPub.isLong(reader["HPassQty"]),         //合格数
                        HBadQty = DBUtility.ClsPub.isLong(reader["HBadQty"]),          //不合格数
                        HPrice = DBUtility.ClsPub.isLong(reader["HPrice"]),//   dec(18,8)         --原币单价
                        HMoney = DBUtility.ClsPub.isLong(reader["HMoney"]),//   dec(18,8)         --原币金额
                        //  HWHID//              --收料仓库
                        HPOOrderInterID = DBUtility.ClsPub.isLong(reader["HPOOrderInterID"]),//
                        HPOOrderEntryID = DBUtility.ClsPub.isLong(reader["HPOOrderEntryID"]),//
                        HPOOrderBillNo = DBUtility.ClsPub.isStrNull(reader["HPOOrderBillNo"]),//
                        HDate = DBUtility.ClsPub.isDate(reader["HDate"]),   //要货时间
                        HState = DBUtility.ClsPub.isLong(reader["HState"]),
                        HBackDate = DBUtility.ClsPub.isStrNull(reader["HBackDate"]),
                        HBacker = DBUtility.ClsPub.isStrNull(reader["HBacker"]),
                        HBillerID = DBUtility.ClsPub.isLong(reader["HBillerID"]),
                        HBillNo = DBUtility.ClsPub.isStrNull(reader["HBillNo"]),
                        HBillStatus = DBUtility.ClsPub.isInt(reader["HBillStatus"]),
                        HBillSubType = DBUtility.ClsPub.isStrNull(reader["HBillSubType"]),
                        HBillType = DBUtility.ClsPub.isStrNull(reader["HBillType"]),
                        HCheckDate = DBUtility.ClsPub.isStrNull(reader["HCheckDate"]),
                        HChecker = DBUtility.ClsPub.isStrNull(reader["HChecker"]),
                        HCheckFlowID = DBUtility.ClsPub.isLong(reader["HCheckFlowID"]),
                        HCheckItemNextID = DBUtility.ClsPub.isLong(reader["HCheckItemNextID"]),
                        HCheckItemNowID = DBUtility.ClsPub.isLong(reader["HCheckItemNowID"]),
                        HCloseDate = DBUtility.ClsPub.isStrNull(reader["HCloseDate"]),
                        // HCloseMan= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HCloseType = DBUtility.ClsPub.isBool(reader["HCloseType"]),
                        //HDate= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HDeleteDate = DBUtility.ClsPub.isStrNull(reader["HDeleteDate"]),
                        HDeleteMan = DBUtility.ClsPub.isStrNull(reader["HDeleteMan"]),
                        HEmpCode = DBUtility.ClsPub.isStrNull(reader["HEmpCode"]),
                        HMainSourceBillNo = DBUtility.ClsPub.isStrNull(reader["HMainSourceBillNo"]),
                        HMainSourceBillType = DBUtility.ClsPub.isStrNull(reader["HMainSourceBillType"]),
                        HMainSourceEntryID = DBUtility.ClsPub.isLong(reader["HMainSourceEntryID"]),
                        HMainSourceInterID = DBUtility.ClsPub.isLong(reader["HMainSourceInterID"]),
                        HMakeDate = DBUtility.ClsPub.isStrNull(reader["HMakeDate"]),
                        HMaker = DBUtility.ClsPub.isStrNull(reader["HMaker"]),
                        HPeriod = DBUtility.ClsPub.isLong(reader["HPeriod"]),
                        HRemark = DBUtility.ClsPub.isStrNull(reader["HRemark"]),
                        HUpDateDate = DBUtility.ClsPub.isStrNull(reader["HUpDateDate"]),
                        HUpDater = DBUtility.ClsPub.isStrNull(reader["HUpDater"]),
                        HYear = DBUtility.ClsPub.isLong(reader["HYear"]),
                        // HCloseMan= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        //  HCloseType= DBUtility.ClsPub.isLong(reader["HEntryID"]),
                        HEntryCloseDate = DBUtility.ClsPub.isDate(reader["HEntryCloseDate"]),
                        HRelationMoney = DBUtility.ClsPub.isLong(reader["HRelationMoney"]),
                        HRelationQty = DBUtility.ClsPub.isLong(reader["HRelationQty"]),
                        //  HRemark= DBUtility.ClsPub.isStrNull(reader["HEntryID"]),
                        HSourceBillNo = DBUtility.ClsPub.isStrNull(reader["HSourceBillNo"]),
                        HSourceBillType = DBUtility.ClsPub.isStrNull(reader["HSourceBillType"]),
                        HSourceEntryID = DBUtility.ClsPub.isLong(reader["HSourceEntryID"]),
                        HSourceInterID = DBUtility.ClsPub.isLong(reader["HSourceInterID"]),
                    });
                }
                reader.Close();
                return POInStockBillList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
       
    }
}