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
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace DAL
{
    public class ClsGy_Supplier_Extend_Ctl:DBUtility.ClsGy_Base_Ctl 
    {
        SQLHelper.ClsCNK3 oCnK3 = new SQLHelper.ClsCNK3(); 
 
        public Model.ClsGy_Supplier_Extend_Model oModel ;
        //新增
        public override bool AddNew()
        {
            
            try
            {
                oCnK3.BeginTran();
                DeleteByID(oModel.HItemID);
                oCnK3.RunProc("Insert into " + MvarItemKey + " " +
                    " (HItemID,HUserID,HPassWord)" +
                    " Values(" + oModel.HItemID.ToString() + ",'" + oModel.HUserID + "','" + oModel.HPassWord + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                oCnK3.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCnK3.RollBack();
                throw (e);
            }
        }
 
        //删除
        public bool DeleteByID(Int64 sItemID)
        {
            try
            {
                oCnK3.RunProc("Delete from " + MvarItemKey + " where HItemID='" + sItemID + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                return true;
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
 
        //构造函数
        public ClsGy_Supplier_Extend_Ctl()
        {
            MvarItemKey = "h_b_Gy_Supplier_Extend";
            MvarReportTitle = "供应商扩展设置";
            oModel = new Model.ClsGy_Supplier_Extend_Model();
        } 
    }
}