From f0b9e513532dd063dc2a48102f710c6add4c802e Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 14 三月 2025 14:19:36 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/WebAPIController.cs | 1871 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 1,642 insertions(+), 229 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 98bd60c..66ae0c8 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -2614,7 +2614,6 @@
DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_BadReason ", "Gy_BadReason");
if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
{
- //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
maxid += 1;
HItemID = maxid;
@@ -2741,7 +2740,7 @@
oItem.HShortNumber = sShortNumber;//鐭唬鐮�
oItem.HEndFlag = true;//鏈骇鏍囧織
oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
-
+ oItem.HMakeEmp = msg2;
oBill.oModel = oItem;
}
@@ -2750,19 +2749,17 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";;
objJsonResult.data = 1;
return objJsonResult;
}
@@ -2781,6 +2778,142 @@
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 涓嶈壇鍘熷洜鑾峰彇淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("GetGy_BadReasonDetail")]
+ [HttpGet]
+ public ApiResult<DataSet> GetGy_BadReasonDetail(string HID)
+ {
+ var model = LuBaoSevice.GetGy_BadReasonBillDetail(HID);
+ return model;
+ }
+
+ /// <summary>
+ /// 涓嶈壇鍘熷洜鍒犻櫎鍔熻兘
+ /// </summary>
+ /// <returns></returns>
+ [Route("DeltetGy_BadReason")]
+ [HttpGet]
+ public object DeltetGy_BadReason(string HItemID, string user)
+ {
+ DataSet ds;
+ //string ModRightNameCheck = "Sc_ProcessReport_check";
+ try
+ {
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_BadReason_Delete", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Gy_BadReason where HItemID=" + HItemID, "Gy_BadReason");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+ //if (HStopflag)
+ //{
+ // oCN.RollBack();//鍥炴粴浜嬪姟
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_BadReason_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadReason_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;
+ 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;
+ }
+ //==================================================================================
+
+
+ oCN.RunProc("delete Gy_BadReason where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_BadReason_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadReason_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -3120,7 +3253,9 @@
#endregion
#endregion
+ #endregion
+ #region 涓嶈壇绫诲瀷 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
/// <summary>
/// 淇濆瓨涓嶈壇绫诲瀷
@@ -3281,7 +3416,7 @@
oItem.HShortNumber = sShortNumber;//鐭唬鐮�
oItem.HEndFlag = true;//鏈骇鏍囧織
oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
-
+ oItem.HMakeEmp = msg2;
oBill.oModel = oItem;
}
@@ -3290,19 +3425,17 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -3321,6 +3454,143 @@
objJsonResult.count = 0;
objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 涓嶈壇绫诲瀷鑾峰彇淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("GetGy_BadTypeDetail")]
+ [HttpGet]
+ public ApiResult<DataSet> GetGy_BadTypeDetail(string HID)
+ {
+ var dataSet = oCN.RunProcReturn("select top 1 * from h_v_gy_BadTypeList where HItemID= " + HID + " ", "h_v_gy_BadTypeList");
+ if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+ return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄤ笉鑹被鍨嬫暟鎹�" };
+ return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+ }
+
+ /// <summary>
+ /// 涓嶈壇绫诲瀷鍒犻櫎鍔熻兘
+ /// </summary>
+ /// <returns></returns>
+ [Route("DeltetGy_BadType")]
+ [HttpGet]
+ public object DeltetGy_BadType(string HItemID, string user)
+ {
+ DataSet ds;
+ //string ModRightNameCheck = "Sc_ProcessReport_check";
+ try
+ {
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Drop", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Gy_BadType where HItemID=" + HItemID, "Gy_BadType");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+ //if (HStopflag)
+ //{
+ // oCN.RollBack();//鍥炴粴浜嬪姟
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_BadType_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadType_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;
+ 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;
+ }
+ //==================================================================================
+
+
+ oCN.RunProc("delete Gy_BadType where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_BadType_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadType_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
return objJsonResult;
}
}
@@ -3631,6 +3901,9 @@
#endregion
#endregion
+ #endregion
+
+ #region 寮傚父绫诲瀷 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
/// <summary>
/// 淇濆瓨寮傚父绫诲瀷
@@ -4271,175 +4544,6 @@
}
#endregion
#endregion
-
- /// <summary>
- /// 涓嶈壇绫诲瀷鑾峰彇淇℃伅
- /// </summary>
- /// <returns></returns>
- [Route("GetGy_BadTypeDetail")]
- [HttpGet]
- public ApiResult<DataSet> GetGy_BadTypeDetail(string HID)
- {
- var dataSet = oCN.RunProcReturn("select top 1 * from h_v_gy_BadTypeList where HItemID= " + HID + " ", "h_v_gy_BadTypeList");
- if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
- return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄤ笉鑹被鍨嬫暟鎹�" };
- return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
- }
-
- /// <summary>
- /// 涓嶈壇绫诲瀷鍒犻櫎鍔熻兘
- /// </summary>
- /// <returns></returns>
- [Route("DeltetGy_BadType")]
- [HttpGet]
- public object DeltetGy_BadType(string HItemID, string user)
- {
- DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
- try
- {
- //鍒犻櫎鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Drop", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- if (string.IsNullOrWhiteSpace(HItemID))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "HItemID涓虹┖锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- oCN.BeginTran();//寮�濮嬩簨鍔�
- ds = oCN.RunProcReturn("select * from Gy_BadType where HItemID=" + HItemID, "Gy_BadType");
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
- objJsonResult.data = null;
- return objJsonResult; ;
- }
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
-
- oCN.RunProc("delete Gy_BadType where HItemID=" + HItemID);
- oCN.Commit();//鎻愪氦浜嬪姟
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
- objJsonResult.data = null;
- return objJsonResult; ;
-
- }
- catch (Exception e)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
- }
-
- /// <summary>
- /// 涓嶈壇鍘熷洜鑾峰彇淇℃伅
- /// </summary>
- /// <returns></returns>
- [Route("GetGy_BadReasonDetail")]
- [HttpGet]
- public ApiResult<DataSet> GetGy_BadReasonDetail(string HID)
- {
- var model = LuBaoSevice.GetGy_BadReasonBillDetail(HID);
- return model;
- }
-
- /// <summary>
- /// 涓嶈壇鍘熷洜鍒犻櫎鍔熻兘
- /// </summary>
- /// <returns></returns>
- [Route("DeltetGy_BadReason")]
- [HttpGet]
- public object DeltetGy_BadReason(string HItemID, string user)
- {
- DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
- try
- {
- //鍒犻櫎鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Gy_BadReason_Delete", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- if (string.IsNullOrWhiteSpace(HItemID))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "HItemID涓虹┖锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- oCN.BeginTran();//寮�濮嬩簨鍔�
- ds = oCN.RunProcReturn("select * from Gy_BadReason where HItemID=" + HItemID, "Gy_BadReason");
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
- objJsonResult.data = null;
- return objJsonResult; ;
- }
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
-
- oCN.RunProc("delete Gy_BadReason where HItemID=" + HItemID);
- oCN.Commit();//鎻愪氦浜嬪姟
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
- objJsonResult.data = null;
- return objJsonResult; ;
-
- }
- catch (Exception e)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
- }
-
#endregion
@@ -4614,11 +4718,11 @@
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
@@ -4712,7 +4816,58 @@
// return objJsonResult;
//}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_BadResult_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadResult_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;
+ 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;
+ }
+ //==================================================================================
+
+
oCN.RunProc("delete Gy_BadResult where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_BadResult_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadResult_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -5172,14 +5327,15 @@
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
+ string sExeReturnInfo = "";
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref sExeReturnInfo);
}
if (bResult)
{
@@ -5194,7 +5350,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + sExeReturnInfo;
objJsonResult.data = 1;
return objJsonResult;
}
@@ -5273,7 +5429,54 @@
// return objJsonResult;
//}
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_InspectValue_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_InspectValue_BeforeDelCtrl");
+
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.RunProc("delete Gy_InspectValue where HItemID=" + HItemID);
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_InspectValue_AfterDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_InspectValue_AfterDelCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -6241,14 +6444,15 @@
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
+ string sExeReturnInfo = "";
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref sExeReturnInfo);
}
if (bResult)
{
@@ -6263,7 +6467,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + sExeReturnInfo;
objJsonResult.data = 1;
return objJsonResult;
}
@@ -6342,7 +6546,55 @@
// return objJsonResult;
//}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_InspectInstruMent_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_InspectInstruMent_BeforeDelCtrl");
+
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+
oCN.RunProc("delete Gy_InspectInstruMent where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_InspectInstruMent_AfterDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_InspectInstruMent_AfterDelCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -7004,19 +7256,17 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -7059,8 +7309,7 @@
[HttpGet]
public object DeltetGy_PostSkill(string HItemID, string user)
{
- DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
+ DataSet ds;
try
{
//鍒犻櫎鏉冮檺
@@ -7093,8 +7342,58 @@
return objJsonResult; ;
}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_PostSkill_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_PostSkill_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_PostSkill where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_PostSkill_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_PostSkill_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -7588,19 +7887,17 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -7644,7 +7941,6 @@
public object DeltetGy_Post(string HItemID, string user)
{
DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
try
{
//鍒犻櫎鏉冮檺
@@ -7677,8 +7973,59 @@
return objJsonResult; ;
}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_Post_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_Post_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_Post where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_Post_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_Post_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -10373,19 +10720,17 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -10417,7 +10762,6 @@
public object DeltetGy_TechnologyType(string HItemID, string user)
{
DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
try
{
//鍒犻櫎鏉冮檺
@@ -10450,8 +10794,59 @@
return objJsonResult; ;
}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_TechnologyParameterClass_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_TechnologyParameterClass_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_TechnologyParameterClass where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_TechnologyParameterClass_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_TechnologyParameterClass_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -11787,14 +12182,15 @@
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
+ string sExeReturnInfo = "";
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref sExeReturnInfo);
}
if (bResult)
{
@@ -11809,7 +12205,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + sExeReturnInfo;
objJsonResult.data = 1;
return objJsonResult;
}
@@ -11898,8 +12294,54 @@
return objJsonResult;
}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_ErrMsgBackType_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_ErrMsgBackType_BeforeDelCtrl");
+
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.RunProc("delete Gy_ErrMsgBackType where HItemID=" + HItemID);
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_ErrMsgBackType_AfterDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_ErrMsgBackType_AfterDelCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -12347,11 +12789,11 @@
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID,ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
@@ -12455,8 +12897,59 @@
return objJsonResult;
}
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_BadPhenomena_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadPhenomena_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_BadPhenomena where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_BadPhenomena_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_BadPhenomena_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -13791,11 +14284,11 @@
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
@@ -13870,8 +14363,56 @@
}
oCN.BeginTran();//寮�濮嬩簨鍔�
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_PreventErrMould_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_PreventErrMould_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;
+ 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;
+ }
+ //==================================================================================
oCN.RunProc("delete Gy_PreventErrMould where HItemID=" + HItemID);
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_PreventErrMould_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_PreventErrMould_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -13924,7 +14465,6 @@
DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_MaintainLev ", "Gy_MaintainLev");
if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
{
- //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
maxid += 1;
HItemID = maxid;
@@ -14063,18 +14603,17 @@
if (oBill.oModel.HItemID == 0)
{
// bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -14116,9 +14655,7 @@
[Route("DeltetGy_MaintainLev")]
[HttpGet]
public object DeltetGy_MaintainLev(string HItemID, string user)
- {
- DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
+ {
try
{
//鍒犻櫎鏉冮檺
@@ -14142,8 +14679,59 @@
}
oCN.BeginTran();//寮�濮嬩簨鍔�
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_MaintainLev_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_MaintainLev_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_MaintainLev where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_MaintainLev_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_MaintainLev_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -14333,11 +14921,11 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- bResult = oBill.AddNew();
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
@@ -14410,8 +14998,58 @@
}
oCN.BeginTran();//寮�濮嬩簨鍔�
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_CheckNoteItem_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_CheckNoteItem_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_CheckNoteItem where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_CheckNoteItem_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_CheckNoteItem_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -15066,10 +15704,736 @@
}
#endregion
-
- #region 鐜妫�娴嬪崟 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
+ #region 宸ヨ壓璺嚎澶х被 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
/// <summary>
- /// 淇濆瓨鐜妫�娴嬪崟
+ /// 宸ヨ壓璺嚎澶х被 淇濆瓨
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("SaveGy_RoutingGroup")]
+ [HttpPost]
+ public object SaveGy_RoutingGroup([FromBody] JObject msg)
+ {
+ DataSet ds;
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg1 = sArray[0].ToString();
+ string msg2 = sArray[1].ToString();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingGroup_Edit", 1, false, msg2))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ Int64 HItemID = 0;
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ //鑾峰彇鏈�澶D鍊艰祴鍊�
+ DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_RoutingGroup ", "Gy_RoutingGroup");
+ if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
+ {
+ //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
+ var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
+ maxid += 1;
+ HItemID = maxid;
+ }
+ ListModels oListModels = new ListModels();
+ try
+ {
+
+ WebAPI.DLL.ClsGy_RoutingGroup_Ctl oBill = new WebAPI.DLL.ClsGy_RoutingGroup_Ctl();
+ List<Model.ClsGy_RoutingGroup_Model> lsmain = new List<Model.ClsGy_RoutingGroup_Model>();
+ msg1 = msg1.Replace("\\", "");
+ msg1 = msg1.Replace("\n", "");
+ lsmain = oListModels.getObjectByJson_Gy_RoutingGroup(msg1);
+ foreach (Model.ClsGy_RoutingGroup_Model oItem in lsmain)
+ {
+ if (oItem.HNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (oItem.HName.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+
+ ds = oCN.RunProcReturn("select * from Gy_RoutingGroup where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_RoutingGroup");
+ if (oItem.HNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鏂板鏃跺垽鏂�
+ if (oItem.HItemID == 0)
+ {
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ else//缂栬緫鏃跺垽鏂�
+ {
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ //寰楀埌鐭唬鐮�
+ string sShortNumber;
+ sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
+ if (sShortNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+ oItem.HEndFlag = true;//鏈骇鏍囧織
+ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+ oItem.HMakeEmp = msg2; //鍒涘缓浜�
+
+ oBill.oModel = oItem;
+ }
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ string sExeReturnInfo = "";
+ if (oBill.oModel.HItemID == 0)
+ {
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ bResult = oBill.AddNew(ref sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref sExeReturnInfo);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+
+ #region 淇敼 宸ヨ壓璺嚎澶х被 鑾峰彇缁戝畾鏁版嵁
+ [Route("Gy_RoutingGroup/EditGy_RoutingGroup")]
+ [HttpGet]
+ public object EditGy_RoutingGroup(long HInterID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingGroup where HItemID=" + HInterID, "h_v_Gy_RoutingGroup");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 宸ヨ壓璺嚎澶х被 瀹℃牳銆佸弽瀹℃牳
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_RoutingGroup/AuditGy_RoutingGroup")]
+ [HttpGet]
+ public object AuditGy_RoutingGroup(int HInterID, int IsAudit, string CurUserName)
+ {
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_RoutingGroup_Check", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_RoutingGroup where HItemID=" + HInterID, "Gy_RoutingGroup");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_BeforeCheckCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_RoutingGroup set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
+
+ //瀹℃牳鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_AfterCheckCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_BeforeUnCheckCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_RoutingGroup set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
+
+ //鍙嶅鏍稿悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_AfterUnCheckCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+
+ /// <summary>
+ /// 宸ヨ壓璺嚎澶х被 绂佺敤銆佸弽绂佺敤
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_RoutingGroup/StopGy_RoutingGroup")]
+ [HttpGet]
+ public object StopGy_RoutingGroup(int HInterID, int IsStop, string CurUserName)
+ {
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_RoutingGroup_Close", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_RoutingGroup where HItemID=" + HInterID, "Gy_RoutingGroup");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ //绂佺敤鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_BeforeStopCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_RoutingGroup set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+ //绂佺敤鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_AfterStopCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ //鍙嶇鐢ㄥ墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_BeforeUnStopCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+
+ oCN.RunProc("update Gy_RoutingGroup set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+ //鍙嶇鐢ㄥ悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_RoutingGroup_AfterUnStopCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ /// <summary>
+ /// 宸ヨ壓璺嚎澶х被 鍒犻櫎鍔熻兘
+ /// </summary>
+ /// <returns></returns>
+ [Route("DeltetGy_RoutingGroup")]
+ [HttpGet]
+ public object DeltetGy_RoutingGroup(string HItemID, string user)
+ {
+ DataSet ds;
+ //string ModRightNameCheck = "Sc_ProcessReport_check";
+ try
+ {
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingGroup_Delete", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ ds = oCN.RunProcReturn("select * from Gy_RoutingGroup where HItemID=" + HItemID, "Gy_RoutingGroup");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_RoutingGroup_BeforeDelCtrl");
+
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+
+ oCN.RunProc("delete Gy_RoutingGroup where HItemID=" + HItemID);
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_RoutingGroup_AfterDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_RoutingGroup_AfterDelCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鐜妫�娴嬮」鐩� 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
+ /// <summary>
+ /// 淇濆瓨鐜妫�娴嬮」鐩�
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
@@ -15100,7 +16464,6 @@
DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_EnvironmentTestItem ", "Gy_EnvironmentTestItem");
if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
{
- //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
maxid += 1;
HItemID = maxid;
@@ -15236,12 +16599,12 @@
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
if (oBill.oModel.HItemID == 0)
- {
- bResult = oBill.AddNew();
+ {
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
{
- bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
}
if (bResult)
{
@@ -15321,9 +16684,59 @@
objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
objJsonResult.data = null;
return objJsonResult; ;
- }
+ }
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_EnvironmentTestItem_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestItem_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;
+ 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;
+ }
+ //==================================================================================
+
oCN.RunProc("delete Gy_EnvironmentTestItem where HItemID=" + HItemID);
+
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_EnvironmentTestItem_AfterDelCtrl " + HItemID + ",'" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_EnvironmentTestItem_AfterDelCtrl");
+ 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;
+ }
+ //==================================================================================
+
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
objJsonResult.count = 1;
--
Gitblit v1.9.1