YL
2021-12-16 54dd292024ea2f68c8551c286e5f8199aca93af6
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace DAL
{
    public class ClsGy_BarCodeBill_View:DBUtility.ClsGy_Base_View
    {
        
        //
        public Model.ClsGy_BarCodeBill_WMS_Model omodel = new Model.ClsGy_BarCodeBill_WMS_Model();
        public Model.ClsGy_BarCodeBill_WMS_Model_View omodel_View = new Model.ClsGy_BarCodeBill_WMS_Model_View();
        public  SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); 
        public ClsGy_BarCodeBill_View()
        {
            base.MvarReportTitle = "条码档案设置";
            base.MvarItemKey = "Gy_BarCodeBill";
            base.SQLName = "Select HItemID,HNumber 条码档案代码,HName 条码档案 from Gy_BarCodeBill where HStopflag=0 Order by HItemID ";
        }
        //
        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }
        //
         
        //返回项目信息
        public override bool GetInfoByID(Int64 sItemID)
        {
            DataSet DS ;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HItemID='" + sItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count  == 0)
                    return false;
                else
                {
                    return GetInfo(DS);
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //根据代码返回项目信息
        public override bool GetInfoByNumber(string sNumber)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HBarCode='" + sNumber + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    return GetInfo(DS);
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        } 
        //返回项目信息
        public override bool GetInfo(DataSet Ds)
        {
            try
            {
                omodel = new Model.ClsGy_BarCodeBill_WMS_Model();
                omodel.HItemID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemID"]);
                omodel.HBarCode = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCode"]);
                omodel.HBarCodeType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCodeType"]);
                omodel.HBatchNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBatchNo"]);
                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
                omodel.HUnitID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HUnitID"]);
                omodel.HQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HQty"]);
                omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
                omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
                omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                omodel.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"]);
                //
                omodel.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"]);
                omodel.HSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceInterID"]);
                omodel.HSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"]);
                omodel.HMTONo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMTONo"]);
                return true;
 
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
 
        //根据代码返回项目信息
        public bool GetInfoByNumber_View(string sNumber)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from h_v_Gy_BarCodeBill Where HBarCode='" + sNumber + "'", "h_v_Gy_BarCodeBill", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    return GetInfo_View(DS);
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
 
        /// <summary>
        /// 根据代码返回项目信息 ForReport
        /// </summary>
        /// <param name="sNumber"></param>
        /// <returns></returns>
        public bool GetInfoForReportByNumber_View(string sNumber)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from h_v_Gy_BarCodeBillForReport Where HBarCode='" + sNumber + "'", "h_v_Gy_BarCodeBillForReport", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    return GetInfo_View(DS);
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
 
        //返回项目信息
        public bool GetInfo_View(DataSet Ds)
        {
            try
            {
                omodel_View = new Model.ClsGy_BarCodeBill_WMS_Model_View();
                omodel_View.HItemID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemID"]);
                omodel_View.HBarCode = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCode"]);
                omodel_View.HBarCodeType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCodeType"]);
                omodel_View.HBatchNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBatchNo"]);
                omodel_View.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
                omodel_View.HMaterNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterNumber"]);
                omodel_View.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]);
                omodel_View.HMaterModel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterModel"]);
                omodel_View.HUnitID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HUnitID"]);
                omodel_View.HUnitName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUnitName"]);
                omodel_View.HQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HQty"]);
                omodel_View.HinitQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HinitQty"]);
                omodel_View.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
                omodel_View.HSupName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSupName"]);
                omodel_View.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
                omodel_View.HGroupName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HGroupName"]);
                omodel_View.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
                omodel_View.HDeptName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeptName"]);
                omodel_View.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"]);
                omodel_View.HBarCodeStatus = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCodeStatus"]);
                //
                omodel_View.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"]);
                omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceInterID"]);
                omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"]);
                //
                omodel_View.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWhID"]);
                omodel_View.HWHName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HWhName"]);
                omodel_View.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                omodel_View.HInstructID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInstructID"]);
                omodel_View.HInstructNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInstructNo"]);
                omodel_View.HSeOrderBillID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSeOrderBillID"]);
                omodel_View.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSeOrderBillNo"]);
                //omodel_View.HCheckerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckerID"]);
 
                omodel_View.HAuxPropID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HAuxPropID"]);
                omodel_View.HAuxPropName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HAuxPropName"]);
                omodel_View.HMTONo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMTONo"]);
                omodel_View.HSTOCKORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSTOCKORGID"]);
                omodel_View.HOWNERID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOWNERID"]);
                return true;
 
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
 
 
 
    }
}