WebAPI/Controllers/Æ·ÖʹÜÀí/»ù´¡×ÊÁÏ/Gy_BaseInformationController.cs
@@ -21,8 +21,8 @@
        private json objJsonResult = new json();
        public DataSet ds = 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();
        public DAL.ClsGy_EnvironmentTestSchemeBillMain OBill = new DAL.ClsGy_EnvironmentTestSchemeBillMain();       //环境检测方案
        public DAL.ClsGy_EnvironmentTestSchemeBillMain BillOld = new DAL.ClsGy_EnvironmentTestSchemeBillMain();  //环境检测方案
        #region çŽ¯å¢ƒæ£€æµ‹é¡¹ç›® æŸ¥è¯¢       
        [Route("Gy_BaseInformation/getGy_EnvironmentTestSchemeBillMainList")]
@@ -312,12 +312,55 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsGy_EnvironmentTestSchemeBillMain BillOld = new DAL.ClsGy_EnvironmentTestSchemeBillMain();
                //判断存在性
                if (BillOld.ShowBill(Int64.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    //删除前控制=========================================
                    string sql1 = "exec h_p_Gy_EnvironmentTestSchemeBill_BeforeDelCtrl  " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestSchemeBill_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                oCN.BeginTran();
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                oCN.RunProc("delete from Gy_EnvironmentTestSchemeBillMain where HInterID = " + HInterID);
                    //删除单据(包含删除后控制、写入日志)
                    if (!BillOld.DeleteBill(BillOld.omodel.HInterID, BillOld.omodel.HBillNo, "h_p_Gy_EnvironmentTestSchemeBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -364,6 +407,7 @@
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Gy_EnvironmentTestSchemeBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
@@ -407,8 +451,32 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //审核前控制=========================================
                        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)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
                        }
                        //==================================================================================
                        //审核单据
                        if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        if (!BillOld.CheckBill(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_EnvironmentTestSchemeBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -450,8 +518,29 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反审核前控制=========================================
                        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)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //===========================================================
                        //反审核单据
                        if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_EnvironmentTestSchemeBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -692,8 +781,31 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //作废前控制=========================================
                        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)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
                        }
                        //==================================================================================
                        //作废单据
                        if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        if (!BillOld.Cancelltion(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_EnvironmentTestSchemeBill_AfterDropCtrl", user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -727,8 +839,31 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反作废前控制=========================================
                        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)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "作废失败!原因:反作废前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "作废失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
                        }
                        //==================================================================================
                        //反作废单据
                        if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_EnvironmentTestSchemeBill_AfterDropCtrl", user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;