DAL/¼Æ»®¹ÜÀí/ClsGy_MaterialTechParamBillMain.cs
@@ -5,7 +5,7 @@
namespace DAL
{
    public  class ClsGy_MaterialTechParamBillMain : DBUtility.ClsXt_BaseBill
    public class ClsGy_MaterialTechParamBillMain : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsGy_MaterialTechParamBillMain omodel = new Model.ClsGy_MaterialTechParamBillMain();
        public List<Model.ClsGy_MaterialTechParamBillSub> DetailColl = new List<Model.ClsGy_MaterialTechParamBillSub>();
@@ -16,9 +16,9 @@
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey= "Gy_MaterialTechParamBillMain";
            base.MvarReportTitle= "产品工艺参数清单";
            base.BillType="3334";
            base.MvarItemKey = "Gy_MaterialTechParamBillMain";
            base.MvarReportTitle = "产品工艺参数清单";
            base.BillType = "3334";
            base.HBillSubType = "3334";
        }
@@ -46,7 +46,7 @@
                    "', HUpDater = '" + omodel.HUpDater +
                    "', HUpDateDate = getdate()" +
                     //===============================================================
                     ", HDeptID = '" + omodel.HDeptID +
                    "', HEmpID = '" + omodel.HEmpID +
                    "', HMaterID = '" + omodel.HMaterID +
@@ -65,30 +65,32 @@
                //插入子表
                omodel.HInterID = lngBillKey;
                //插入子表
                foreach (Model.ClsGy_MaterialTechParamBillSub oSub in DetailColl)
                {
                    string subSql = "insert into Gy_MaterialTechParamBillSub" +
                            "" +
                            "" +
                            "" +
                            "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                            ",HTechParamID,HTechParamUnitID,HStd,HMax,HMin,HDataForm,HDataUnit,HDataTimes) " +
                            " values(" +
                            "" + omodel.HInterID.ToString() +
                            "," + oSub.HEntryID.ToString() +
                            "," + oSub.HSourceInterID +
                            "," + oSub.HSourceEntryID +
                            ",'" + oSub.HSourceBillNo +
                            "','" + oSub.HSourceBillType +
                            "','" + oSub.HTechParamID +
                             "','" + oSub.HTechParamUnitID +
                            "'," + oSub.HStd +
                            "," + oSub.HMax +
                            ",'" + oSub.HMin +
                            "','" + oSub.HDataForm +
                            "','" + oSub.HDataUnit +
                           "'," + oSub.HDataTimes +
                            ")";
                           "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                           ",HTechParamID,HTechParamUnitID,HStd,HMax,HMin,HDataForm,HDataUnit,HDataTimes,HTechParamClassID,HSNO,HStdNextTimes,HTechParamIDStd) " +
                           " values(" +
                           "" + omodel.HInterID.ToString() +
                           "," + oSub.HEntryID.ToString() +
                           "," + oSub.HSourceInterID +
                           "," + oSub.HSourceEntryID +
                           ",'" + oSub.HSourceBillNo +
                           "','" + oSub.HSourceBillType +
                           "','" + oSub.HTechParamID +
                           "','" + oSub.HTechParamUnitID +
                           "'," + oSub.HStd +
                           "," + oSub.HMax +
                           ",'" + oSub.HMin +
                           "','" + oSub.HDataForm +
                           "','" + oSub.HDataUnit +
                           "','" + oSub.HDataTimes +
                           "','" + oSub.HTechParamClassID +
                           "','" + oSub.HSNO +
                           "','" + oSub.HStdNextTimes +
                           "','" + oSub.HTechParamIDStd +
                           "')";
                    oCn.RunProc(subSql);
                }
@@ -97,7 +99,7 @@
                return true;
            }
            catch (Exception e)
            {
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
@@ -119,7 +121,7 @@
                while (true)
                {
                    ds = oCn.RunProcReturn("select * from Gy_MaterialTechParamBillMain where HInterID = " + omodel.HInterID, "Gy_MaterialTechParamBillMain");
                    if(ds!=null && ds.Tables[0].Rows.Count > 0)
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                    }
@@ -160,11 +162,8 @@
                foreach (Model.ClsGy_MaterialTechParamBillSub oSub in DetailColl)
                {
                    string subSql = "insert into Gy_MaterialTechParamBillSub" +
                           "" +
                           "" +
                           "" +
                           "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                           ",HTechParamID,HTechParamUnitID,HStd,HMax,HMin,HDataForm,HDataUnit,HDataTimes) " +
                           ",HTechParamID,HTechParamUnitID,HStd,HMax,HMin,HDataForm,HDataUnit,HDataTimes,HTechParamClassID,HSNO,HStdNextTimes,HTechParamIDStd) " +
                           " values(" +
                           "" + omodel.HInterID.ToString() +
                           "," + oSub.HEntryID.ToString() +
@@ -173,14 +172,18 @@
                           ",'" + oSub.HSourceBillNo +
                           "','" + oSub.HSourceBillType +
                           "','" + oSub.HTechParamID +
                            "','" + oSub.HTechParamUnitID +
                           "','" + oSub.HTechParamUnitID +
                           "'," + oSub.HStd +
                           "," + oSub.HMax +
                           ",'" + oSub.HMin +
                           "','" + oSub.HDataForm +
                            "','" + oSub.HDataUnit +
                           "'," + oSub.HDataTimes +
                           ")";
                           "','" + oSub.HDataUnit +
                           "','" + oSub.HDataTimes +
                           "','" + oSub.HTechParamClassID +
                           "','" + oSub.HSNO +
                           "','" + oSub.HStdNextTimes +
                           "','" + oSub.HTechParamIDStd +
                           "')";
                    oCn.RunProc(subSql);
                }
                sReturn = "新增单据成功!";
@@ -239,7 +242,7 @@
                //========================================================
                omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]);
                //
                //循环
@@ -263,7 +266,7 @@
                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
                    //===================================================
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";