yusijie
2024-10-31 aa163d95ef7e56aff066a11dad66083bcd373f95
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace DAL
{
    public class ClsSc_ICMOBillQualityStatus_Tmp : DBUtility.ClsXt_BaseBill 
    {
        //
        public Model.ClsSc_ICMOBillQualityStatus_Tmp omodel = new Model.ClsSc_ICMOBillQualityStatus_Tmp(); 
 
        public ClsSc_ICMOBillQualityStatus_Tmp()
        {
            base.MvarItemKeySub = "";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sc_ICMOBillQualityStatus_Tmp";
            base.MvarReportTitle="Éú²úÖÊÁ¿×´Ì¬ÁÙʱ±í";
            base.BillType = "3723"; 
        }
 
        #region ¹Ì¶¨´úÂë
 
        ~ClsSc_ICMOBillQualityStatus_Tmp()
        { 
        }
       
        #endregion   ×Ô¶¨Òå·½·¨
        //Ð޸ĵ¥¾Ý
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //¸üÐÂÖ÷±í
                oCn.RunProc("UpDate Sc_ICMOBillQualityStatus_Tmp set  " +
                "HReportEntryID=" + omodel.HReportEntryID.ToString() +
                ",HSourceID=" + omodel.HSourceID.ToString() +
                ",HReportType=" + omodel.HReportType.ToString() +
                ",HBadReasonID=" + omodel.HBadReasonID.ToString() +
                ",HWasterReasonID=" + omodel.HWasterReasonID.ToString() + 
                ",HBarCode='" + omodel.HBarCode + "'" +
                ",HAddr='" + omodel.HAddr + "'" +
                ",HSourceInterID=" + omodel.HSourceInterID.ToString() + 
                ",HSourceEntryID=" + omodel.HSourceEntryID.ToString() + 
                ",HSourceBillNo='" + omodel.HSourceBillNo + "'" +
                ",HSourceBillType='" + omodel.HSourceBillType + "'" +
                ",HSplitNO='" + omodel.HSplitNO + "'" +
                ",HRelationInterID=" + omodel.HRelationInterID.ToString() +
                ",HRelationEntryID=" + omodel.HRelationEntryID.ToString() + 
                ",HRelationBillNo='" + omodel.HRelationBillNo + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //ɾ³ý¹ØÁª
                DeleteRelation(ref sReturn, lngBillKey);
                
                sReturn = "Ð޸ĵ¥¾Ý³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //ÐÂÔöµ¥¾Ý
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //µÃµ½mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //ÈôMAINDIÖØ¸´ÔòÖØÐ»ñÈ¡
                oCn.BeginTran();
                //Ö÷±í
                oCn.RunProc("Insert Into Sc_ICMOBillQualityStatus_Tmp   " +
                "(HInterID,HReportEntryID,HBillType" +
                ",HSourceID,HReportType,HBadReasonID,HWasterReasonID" +
                ",HBarCode,HAddr,HMaker,HMakeDate" +
                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSplitNO,HSourceBillType" +
                ",HRelationInterID,HRelationEntryID,HRelationBillNo" +
                ") " +
                " values(" + omodel.HInterID.ToString() + "," + omodel.HReportEntryID.ToString() + ",'" + BillType + "'" +
                "," + omodel.HSourceID.ToString() + "," + omodel.HReportType.ToString() + "," + omodel.HBadReasonID.ToString() + "," + omodel.HWasterReasonID.ToString() +
                ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.GetServerDate(-1) + "'" +
                "," + omodel.HSourceInterID.ToString() + "," + omodel.HSourceEntryID.ToString() + ",'" + omodel.HSourceBillNo + "','" + omodel.HSplitNO + "','" + omodel.HSourceBillType + "'" +
                "," + omodel.HRelationInterID.ToString() + "," + omodel.HRelationEntryID.ToString() + ",'" + omodel.HRelationBillNo + "'" +
                ") ");
                 
                sReturn = "ÐÂÔöµ¥¾Ý³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
 
        //ÐÂÔöµ¥¾Ý
        public bool AddBill1(ref string sReturn)
        {
            try
            {
                //ÈôMAINDIÖØ¸´ÔòÖØÐ»ñÈ¡
                oCn.BeginTran();
                string sql = "Insert into Sc_ICMOBillQualityStatus_Tmp"+ 
                                "(HBarCode,HInterID,HBillNo,HCheckManID,HBadReasonID,HWasterReasonID,HResult,HAddr," +
                                "HRemark,HSaveType,HICMOInterID,HICMOEntryID,HICMOBillNo,HSplitNo,HMaterID,HProcID,HSourceID,HDate,HGroupID,HDeptID,HStationID," +
                                "HPRDORGID,HAuxPropID,HBillType,HBillSubType,HReportType,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationInterID," +
                                "HRelationEntryID,HRelationBillNo,HMaker,HMakeDate)" +
                                "values(" +
                                "'" + omodel.HBarCode +
                                "'," + omodel.HInterID +
                                ",'" + omodel.HBillNo +
                                "'," + omodel.HCheckManID +
                                "," + omodel.HBadReasonID +
                                "," + omodel.HWasterReasonID +
                                ",'" + omodel.HResult +
                                "','" + omodel.HAddr +
                                "','" + omodel.HRemark +
                                "','" + omodel.HSaveType +
                                "'," + omodel.HICMOInterID +
                                "," + omodel.HICMOEntryID +
                                ",'" + omodel.HICMOBillNo +
                                "','" + omodel.HSplitNO +
                                "'," + omodel.HMaterID +
                                "," + omodel.HProcID +
                                "," + omodel.HSourceID +
                                ",'" + omodel.HDate +
                                "'," + omodel.HGroupID +
                                "," + omodel.HDeptID +
                                "," + omodel.HStationID +
                                "," + omodel.HPRDORGID +
                                "," + omodel.HAuxPropID +
                                ",'" + BillType +
                                "','" + "" +
                                "'," + omodel.HReportType +
                                "," + omodel.HSourceInterID +
                                "," + omodel.HSourceEntryID +
                                ",'" + omodel.HSourceBillNo +
                                "','" + omodel.HSourceBillType +
                                "'," + omodel.HRelationInterID +
                                "," + omodel.HRelationEntryID +
                                ",'" + omodel.HRelationBillNo +
                                "','" + omodel.HMaker +
                                "','" + omodel.HMakeDate +
                                "')";
 
                //Ö÷±í
                oCn.RunProc(sql);
                sReturn = "ÐÂÔöµ¥¾Ý³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
 
        //ÏÔʾµ¥¾Ý
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //²éѯÖ÷±í
                DataSet Ds ;
                Ds = oCn.RunProcReturn("Select * from Sc_ICMOBillQualityStatus_Tmp Where HInterID=" + lngBillKey.ToString(), "Sc_ICMOBillQualityStatus_Tmp");
                if(Ds.Tables[0].Rows.Count==0)
                {
                    sReturn = "µ¥¾ÝδÕÒµ½£¡";
                    return false;
                }
                //¸³Öµ
                omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                omodel.HReportEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HReportEntryID"]);
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
                omodel.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
                omodel.HReportType = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HReportType"]);
                omodel.HBadReasonID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBadReasonID"]);
                omodel.HWasterReasonID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWasterReasonID"]);
                omodel.HBarCode = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCode"]);
                omodel.HAddr = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HAddr"]);
                omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]);
                omodel.HMakeDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HMakeDate"]);
                omodel.HSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceInterID"]);
                omodel.HSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"]);
                omodel.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"]);
                omodel.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"]);
                omodel.HRelationInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRelationInterID"]);
                omodel.HRelationEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRelationEntryID"]);
                omodel.HRelationBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRelationBillNo"]);
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //
 
 
                sReturn = "ÏÔʾµ¥¾Ý³É¹¦£¡";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
       
    }
}