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
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
 
namespace DAL
{
    public class ClsCB_EntrustMoneyCost_D:DBUtility.ClsXt_BaseBill 
    {
 
        public Model.ClsCB_EntrustMoneyCost_M omodel = new Model.ClsCB_EntrustMoneyCost_M();
        
        public ClsCB_EntrustMoneyCost_D()
        {
            base.MvarItemKeySub = "";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "CB_EntrustMoneyCost";
            base.MvarReportTitle="委外成本表";
            base.BillType="1815";
            base.HBillSubType = "1815";
 
        }
 
        #region 固定代码
 
        ~ClsCB_EntrustMoneyCost_D()
        {
            //DetailColl = null;
        }
       
        #endregion   自定义方法
        //新增
        public override bool AddBill(ref string sReturn)
        {
            
            try
            {
                oCn.BeginTran();
                //foreach (Model.ClsCB_MaterMoneyCost_M omodel in DetailColl)
                //{
                oCn.RunProc("Insert into CB_EntrustMoneyCost " +
                    " (HYear,HPeriod,HBillType,HRelationInterID" +
                    ",HMaterID,HQty,HPrice,HMoney" +
                    ",HDeptID,HRemark,HMaker,HMakeDate" +
                    ",HPrice_New,HPrice_H,HPrice_L,HProcID)" +
                    " Values("
                    + omodel.HYear.ToString() + "," +omodel.HPeriod.ToString() + ",'" + omodel.HBillType+"',"+ omodel.HRelationInterID.ToString() +
                    "," + omodel.HMaterID.ToString() +"," + omodel.HQty.ToString() +","+omodel.HPrice.ToString() +"," +omodel.HMoney.ToString() +
                    "," + omodel.HDeptID.ToString() +",'" +omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + 
                    "," + omodel.HPrice_New.ToString() +"," +omodel.HPrice_H.ToString() +"," +omodel.HPrice_L.ToString() + ","  +omodel.HProcID.ToString() +
 
                     ") ");
                //修改上级为非末级代码
                //}
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
 
        //修改
     
 
    
    }
}