jinghz@oceic.com
2023-08-24 c5cfa2df88c6d2e5b31e87e1d5a8fe49d585f0bb
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
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace DAL
{
    public class ClsGy_SourceWorkStationSet : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();       
        public Model.ClsGy_SourceWorkStationSet oModel = new Model.ClsGy_SourceWorkStationSet();
        //构造函数
        public ClsGy_SourceWorkStationSet()
        {
            MvarItemKey = "Gy_SourceWorkStationSet";
            MvarReportTitle = "产线工位";
            oModel = new Model.ClsGy_SourceWorkStationSet();
        }
 
        //新增
        public override bool AddNew()
        {
            try
            {
                string ssql = "Insert into " + MvarItemKey + " " +
                    "(HMacAddr,HSourceID,HProdOrgID,HWorkStationID,HProcID," +
                    " HType,HVideo,HRemark,HCreateDate,HCreator)" +
                    " Values('" + oModel.HMacAddr + "'," + oModel.HSourceID + "," + oModel.HProdOrgID + "," + oModel.HWorkStationID + "," 
                                + oModel.HProcID + ",'" + oModel.HType + "'," + oModel.HVideo + ",'" + oModel.HRemark + "','"
                                + oModel.HCreateDate + "','" + oModel.HCreator + "')";
                oCn.BeginTran();
                oCn.RunProc(ssql, ref DBUtility.ClsPub.sExeReturnInfo);           
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
 
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                string ssql = "Update " + MvarItemKey + " set " +
                            "HMacAddr='" + oModel.HMacAddr + "'" +
                            ",HSourceID='" + oModel.HSourceID + "'" +
                            ",HProdOrgID='" + oModel.HProdOrgID + "'" +
                            ",HWorkStationID= '" + oModel.HWorkStationID + "'" +
                            ",HProcID='" + oModel.HProcID + "'" +
                            ",HType='" + oModel.HType + "'" +
                            ",HVideo='" + oModel.HVideo +"' Where  HItemID = " + sItemID;
                oCn.BeginTran();
                oCn.RunProc(ssql, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }        
    }
}