llj
8 天以前 2bf6de5d4748d28f7f3a098af25503d6a0c619d1
WebAPI/Controllers/Æ·ÖʹÜÀí/»ù´¡×ÊÁÏ/Gy_BaseInformationController.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_EnvironmentTestSchemeBillMain OBill = new DAL.ClsGy_EnvironmentTestSchemeBillMain();       //环境检测方案
        public DAL.ClsGy_EnvironmentTestSchemeBillMain BillOld = new DAL.ClsGy_EnvironmentTestSchemeBillMain();  //环境检测方案
@@ -316,6 +317,15 @@
                //判断存在性
                if (BillOld.ShowBill(Int64.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    //判断是否可编辑
                    if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "此单据已经被审核,不允许删除!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //删除前控制=========================================      
                    string sql1 = "exec h_p_Gy_EnvironmentTestSchemeBill_BeforeDelCtrl  " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeDelCtrl");
@@ -414,7 +424,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)
@@ -453,8 +462,8 @@
                        }
                        //审核前控制=========================================      
                        string sql1 = "exec h_p_Gy_EnvironmentTestSchemeBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeCheckCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -464,11 +473,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;
@@ -489,7 +498,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)
@@ -520,8 +528,8 @@
                        }
                        //反审核前控制=========================================        
                        string sql1 = "exec h_p_Gy_EnvironmentTestSchemeBill_BeforeUnCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeUnCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeUnCheckCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -530,11 +538,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;
                        }
@@ -752,7 +760,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)
@@ -783,8 +790,8 @@
                        }
                        //作废前控制=========================================      
                        string sql1 = "exec h_p_Gy_EnvironmentTestSchemeBill_BeforeDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeDropCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeDropCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -794,11 +801,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;
@@ -841,8 +848,8 @@
                        }
                        //反作废前控制=========================================      
                        string sql1 = "exec h_p_Gy_EnvironmentTestSchemeBill_BeforeUnDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeUnDropCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeUnDropCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -852,11 +859,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;