1
wtt
9 天以前 409529b1a6e7478d691e95f84713bdd5ad5ffed2
WebAPI/Controllers/CJGL/Gy_MaterPreventErrMouldBillController.cs
@@ -20,6 +20,7 @@
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//单据状态(新增,修改,浏览,更新单价,变更)
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public DataSet ds1 = new DataSet();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        public DAL.ClsGy_MaterPreventErrMouldBillMain OBill = new DAL.ClsGy_MaterPreventErrMouldBillMain();
        public DAL.ClsGy_MaterPreventErrMouldBillMain BillOld = new DAL.ClsGy_MaterPreventErrMouldBillMain();
@@ -472,7 +473,6 @@
                if (Type == 1)
                {
                    //判断单据是否已经审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -511,8 +511,8 @@
                        }
                        //审核前控制=========================================      
                        string sql1 = "exec h_p_Gy_MaterPreventErrMouldBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeCheckCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -522,11 +522,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "审核失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
@@ -547,7 +547,6 @@
                else
                {
                    //判断单据是否已经反审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
@@ -578,8 +577,8 @@
                        }
                        //反审核前控制=========================================        
                        string sql1 = "exec h_p_Gy_MaterPreventErrMouldBill_BeforeUnCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeUnCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeUnCheckCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -588,11 +587,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "反审核失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -810,7 +809,6 @@
                if (Type == 1)
                {
                    //判断单据是否已经作废
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -841,8 +839,8 @@
                        }
                        //作废前控制=========================================      
                        string sql1 = "exec h_p_Gy_MaterPreventErrMouldBill_BeforeDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeDropCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeDropCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -852,11 +850,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "审核失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
@@ -876,7 +874,6 @@
                else
                {
                    //判断单据是否已经反作废
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
@@ -899,8 +896,8 @@
                        }
                        //反作废前控制=========================================      
                        string sql1 = "exec h_p_Gy_MaterPreventErrMouldBill_BeforeUnDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeUnDropCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_MaterPreventErrMouldBill_BeforeUnDropCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -910,11 +907,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "作废失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "作废失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
@@ -1041,6 +1038,9 @@
                if (!tb2.Columns.Contains("失效验证方法"))
                    error += "没有找到【失效验证方法】的标题,";
                if (!tb2.Columns.Contains("防错结果"))
                    error += "没有找到【防错结果】的标题,";
                if (!tb2.Columns.Contains("表体备注"))
                    error += "没有找到【表体备注】的标题,";
@@ -1270,6 +1270,7 @@
                    string HPreventErrNote = item["防错功能"].ToString();
                    string HLoseMode = item["失效模式"].ToString();
                    string HLoseCheck = item["失效验证方法"].ToString();
                    string HPreventErrResult = item["防错结果"].ToString();
                    ds = oCN.RunProcReturn("select * from Gy_MaterPreventErrMouldBillMain where HBillNo='" + HBillNo + "'", "Gy_MaterPreventErrMouldBillMain");
@@ -1297,7 +1298,7 @@
                        //插入子表
                        oCN.RunProc("insert into Gy_MaterPreventErrMouldBillSub " +
                        "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" +
                        ",HPreventErrMouldID,HPreventErrNote,HLoseMode,HLoseCheck) " +
                        ",HPreventErrMouldID,HPreventErrNote,HLoseMode,HLoseCheck,HPreventErrResult) " +
                        " values(" +
                        "" + HInterID.ToString() +
                        "," + 1 +
@@ -1310,6 +1311,7 @@
                        "','" + HPreventErrNote +
                        "','" + HLoseMode +
                        "','" + HLoseCheck +
                        "','" + HPreventErrResult +
                        "')");
                    }
                    else
@@ -1325,7 +1327,7 @@
                        //插入子表
                        oCN.RunProc("insert into Gy_MaterPreventErrMouldBillSub " +
                        "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" +
                        ",HPreventErrMouldID,HPreventErrNote,HLoseMode,HLoseCheck) " +
                        ",HPreventErrMouldID,HPreventErrNote,HLoseMode,HLoseCheck,HPreventErrResult) " +
                        " values(" +
                        "" + HInterID.ToString() +
                        "," + HEntryID +
@@ -1338,6 +1340,7 @@
                        "','" + HPreventErrNote +
                        "','" + HLoseMode +
                        "','" + HLoseCheck +
                        "','" + HPreventErrResult +
                        "')");
                    }