using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsK3_MatePriceSup_Ctl:DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCNK3 oK3Cn = new SQLHelper.ClsCNK3(); public Model.ClsK3_MatePriceSup_Model oModel ; //K3单据新增 public bool AddNew_K3() { try { oK3Cn.BeginTran(); DataSet Ds; //得到mainid Ds = oK3Cn.RunProcReturn("declare @InterID int set @InterID=0 exec GetICMaxNum 't_Supply', @InterID output, 1, 16394 select ltrim(@InterID)", "GetICMaxNum"); oModel.HEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]); oK3Cn.RunProc("Insert into " + MvarItemKey + " " + " (FEntryID,FBrNo,FSupID,FItemID,FUnitID" + ",FStartQty,FEndQty,FPrice,FCyID,FDiscount" + ",FLeadTime,FQuoteTime,FUsed,FDisableDate,FRemark" + ",FPType,FLastModifiedDate,FLastModifiedBy) " + " Values(" + oModel.HEntryID.ToString() + ",0," + oModel.HSupID.ToString() + "," + oModel.HMaterID.ToString() + "," + oModel.HUnitID.ToString() + "," + oModel.HStartQty.ToString() + "," + oModel.HEndQty.ToString() + "," + oModel.HPrice.ToString() + "," + oModel.HCurID.ToString() + "," + oModel.HDiscount.ToString() + ",0,'" + oModel.HQuoteTime.ToShortDateString() + "'," + DBUtility.ClsPub.BoolToString(oModel.HUsed) + ",'" + oModel.HDisableDate.ToShortDateString() + "','" + oModel.HRemark + "'" + ",1,getdate(),16394" + ")", ref DBUtility.ClsPub.sExeReturnInfo); oK3Cn.Commit(); return true; } catch (Exception e) { oK3Cn.RollBack(); throw (e); } } //构造函数 public ClsK3_MatePriceSup_Ctl() { MvarItemKey = "t_SupplyEntry"; MvarReportTitle = "采购价格表设置"; oModel = new Model.ClsK3_MatePriceSup_Model(); } } }