| | |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using System.Data; |
| | | using SyntacticSugar.constant; |
| | | using DBUtility; |
| | | using System.Text; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region è·åPNLInfoå表 |
| | | [Route("Gy_PNLInfoController/GetGy_PNLInfoList")] |
| | |
| | | { |
| | | try |
| | | { |
| | | return null; |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfo_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_Gy_PNLInfoList where 1=1 " + sWhere + " order by HInterID", "h_v_Gy_PNLInfoList"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è·åPNLInfoå表å表 |
| | | [Route("Gy_PNLInfoController/GetGy_PNLInfoSubList")] |
| | | [HttpGet] |
| | | public object GetGy_PNLInfoSubList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfo_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_Gy_PNLInfoSubList where 1=1 " + sWhere + " order by HInterID", "h_v_Gy_PNLInfoSubList"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | #endregion |
| | | |
| | | #region è·åPNLInfoå表 å页 |
| | | [Route("Gy_PNLInfoController/GetGy_PNLInfoListPage")] |
| | | [HttpGet] |
| | | public object GetGy_PNLInfoListPage(string sWhere, string user, string page, string size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfo_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (string.IsNullOrWhiteSpace(sWhere) == false) |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | } |
| | | |
| | | string sql = "exec h_p_Gy_PNLInfo_ListPage " + page + "," + size + ",'" + sWhere + "'"; |
| | | |
| | | DataSet ds = oCN.RunProcReturn(sql, "h_p_Gy_PNLInfo_ListPage"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è·åPNLInfoå表å表 å页 |
| | | [Route("Gy_PNLInfoController/GetGy_PNLInfoSubListPage")] |
| | | [HttpGet] |
| | | public object GetGy_PNLInfoSubListPage(string sWhere, string user, string page, string size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfo_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (string.IsNullOrWhiteSpace(sWhere) == false) |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | } |
| | | |
| | | string sql = "exec h_p_Gy_PNLInfoSub_ListPage " + page + "," + size + ",'" + sWhere + "'"; |
| | | |
| | | DataSet ds = oCN.RunProcReturn(sql, "h_p_Gy_PNLInfoSub_ListPage"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ·»å PNLInfo æ·»å å表 |
| | | [Route("Gy_PNLInfoController/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); // 表åä¿¡æ¯ |
| | | string msg3 = sArray[1].ToString();// åè¡¨ä¿¡æ¯ |
| | | string msg4 = sArray[2].ToString(); // å¶åäººä¿¡æ¯ |
| | | //string msg4 = sArray[2].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsGy_PNLInfo> list = JsonConvert.DeserializeObject<List<ClsGy_PNLInfo>>(msg2); |
| | | List<ClsGy_PNLInfoSub> lsmain = JsonConvert.DeserializeObject<List<ClsGy_PNLInfoSub>>(msg3); |
| | | |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_PNLInfo_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°å¢æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | DataSet ds_editCheck; |
| | | //ä¿ååæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_BeforeSaveCtrl " + msg4 + ",'1'", "h_p_Gy_PNLInfo_BeforeSaveCtrl"); |
| | | if (ds_editCheck == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | ds_editCheck = oCN.RunProcReturn("select top 1 HInterID from Gy_PNLInfo where HLayOutName=N'" + list[0].HLayOutName + "'", "Gy_PNLInfo"); |
| | | if(ds_editCheck.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "PNLå¸å±éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql1 = "insert into Gy_PNLInfo(HLayOutName,HIcon,HRowCount,HColCount,HMaker,HMakeDate,HPNLPosition_x,HPNLPosition_y) values(" + |
| | | "N'" + list[0].HLayOutName + "'," + |
| | | "N'" + list[0].HIcon + "'," + |
| | | "N'" + list[0].HRowCount + "'," + |
| | | "N'" + list[0].HColCount + "'," + |
| | | "N'" + list[0].HMaker + "'," + |
| | | "N'" + list[0].HMakeDate + "'," + |
| | | "N'" + list[0].HPNLPosition_x + "'," + |
| | | "N'" + list[0].HPNLPosition_y + "'" + |
| | | ")"; |
| | | //LogService.Write("æ§è¡sqlè¯å¥:" + sql1); |
| | | DataSet ds = oCN.RunProcReturn(sql1, "Gy_PNLInfo"); |
| | | ds = oCN.RunProcReturn("Select TOP 1 HInterID from Gy_PNLInfo where HLayOutName=N'" + list[0].HLayOutName + "'", "Gy_PNLInfo"); |
| | | if(ds.Tables[0].Rows.Count < 1) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
ç ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string currHInterID = ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | HashSet<string> HSetNoHashSet = new HashSet<string>(); |
| | | HashSet<string> HPCSNoHashSet = new HashSet<string>(); |
| | | List<string> HUpdateLangList = new List<string>(); |
| | | string insertLangTemplet = "insert into Gy_PNLInfoSub(HInterID,HLayOutName,HSetNo,HPCSNo,HPosition_x,HPosition_y" + |
| | | ",HSetPosition_y, HSetPosition_x ) values( "; |
| | | int batchNum = 100; |
| | | StringBuilder updateLangBuilder = new StringBuilder(); |
| | | foreach (var lsone in lsmain) |
| | | { |
| | | |
| | | if(HPCSNoHashSet.Contains(lsone.HPCSNo) == true) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "PCSç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | HSetNoHashSet.Add(lsone.HSetNo); |
| | | HPCSNoHashSet.Add(lsone.HPCSNo); |
| | | |
| | | batchNum--; |
| | | updateLangBuilder.Append(insertLangTemplet); |
| | | updateLangBuilder.Append("N'" + currHInterID + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HLayOutName + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HSetNo + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HPCSNo + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HPosition_x + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HPosition_y + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HSetPosition_y + "',"); |
| | | updateLangBuilder.Append("N'" + lsone.HSetPosition_x + "'"); |
| | | updateLangBuilder.Append(");"); |
| | | |
| | | |
| | | if (batchNum == 0) |
| | | { |
| | | HUpdateLangList.Add(updateLangBuilder.ToString()); |
| | | updateLangBuilder.Clear(); |
| | | batchNum = 100; |
| | | } |
| | | } |
| | | |
| | | HUpdateLangList.Add(updateLangBuilder.ToString()); |
| | | updateLangBuilder.Clear(); |
| | | |
| | | string HSetNoInStr = "(" + string.Join(",", HSetNoHashSet.ToArray<string>()) + ")"; |
| | | string HPCSNoInStr = "(" + string.Join(",", HPCSNoHashSet.ToArray<string>()) + ")"; |
| | | |
| | | // 夿æ¯å¦æsetç æè
PCSç éå¤çé¨å |
| | | ds = oCN.RunProcReturn("select top 1 HEntryID from Gy_PNLInfoSub where HSetNo in " + HSetNoInStr |
| | | + "AND HPCSNo in " + HPCSNoInStr + "AND HInterID = " + currHInterID, "Gy_PNLInfoSub"); |
| | | //LogService.Write("æ§è¡ SQL è¯å¥: select top 1 HEntryID from Gy_PNLInfoSub where HSetNo in " + HSetNoInStr |
| | | // + "AND HPCSNo in " + HPCSNoInStr); |
| | | |
| | | if(ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Setç æè
PCSç æéå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | HUpdateLangList.ForEach(HUpdateLang => |
| | | { |
| | | //LogService.Write("æ§è¡ SQL è¯å¥: " + HUpdateLang); |
| | | ds = oCN.RunProcReturn(HUpdateLang, "Gy_PNLInfoSub"); |
| | | }); |
| | | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterSaveCtrl " + msg4 + ",'1'", "h_p_Gy_PNLInfo_AfterSaveCtrl"); |
| | | if (ds_editCheck == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å é¤PNLInfo å é¤å表 |
| | | [Route("Gy_PNLInfoController/DeleteBill")] |
| | | [HttpGet] |
| | | public object DeleteBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_PNLInfo_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet ds_editCheck; |
| | | oCN.BeginTran(); |
| | | //å é¤åæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_BeforeDelCtrl " + HInterID + "," + user, "h_p_Gy_PNLInfo_BeforeDelCtrl"); |
| | | if (ds_editCheck == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | ds = oCN.RunProcReturn("delete from Gy_PNLInfo where HInterID = " + HInterID, "Gy_PNLInfo"); |
| | | |
| | | ds = oCN.RunProcReturn("delete from Gy_PNLInfoSub where HInterID = " + HInterID, "Gy_PNLInfoSub"); // å é¤å表 |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterDelCtrl " + HInterID + "," + user, "h_p_Gy_PNLInfo_AfterDelCtrl"); |
| | | if (ds_editCheck == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤åå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥" + DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //LogService.Write(e); |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region æ´æ°PNLInfo æ´æ°å表 |
| | | [Route("Gy_PNLInfoController/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); // 表åä¿¡æ¯ |
| | | string msg3 = sArray[1].ToString();// åè¡¨ä¿¡æ¯ |
| | | string msg4 = sArray[2].ToString(); // å¶åäººä¿¡æ¯ |
| | | string msg5 = sArray[3].ToString(); // å é¤è¡¨åä¿¡æ¯(HEntryID å表) |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsGy_PNLInfo> list = JsonConvert.DeserializeObject<List<ClsGy_PNLInfo>>(msg2); |
| | | List<ClsGy_PNLInfoSub> lsmain = JsonConvert.DeserializeObject<List<ClsGy_PNLInfoSub>>(msg3); |
| | | List<int> delEntryIDList = JsonConvert.DeserializeObject<List<int>>(msg5); |
| | | |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_PNLInfo_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°å¢æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | DataSet ds_editCheck; |
| | | //ä¿ååæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_BeforeSaveCtrl " + msg4 + ",'2'", "h_p_Gy_PNLInfo_BeforeSaveCtrl"); |
| | | if (ds_editCheck == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | ds_editCheck = oCN.RunProcReturn("select top 1 HInterID from Gy_PNLInfo where HLayOutName=N'" + list[0].HLayOutName + "'" |
| | | + "AND HInterID != N'" + list[0].HInterID + "'", "Gy_PNLInfo"); |
| | | if (ds_editCheck.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "PNLå¸å±éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | // 主表 æ´æ° |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.Append("Update Gy_PNLInfo set "); |
| | | sb.Append("HLayOutName=N'"+ list[0].HLayOutName + "',"); |
| | | sb.Append("HIcon=N'" + list[0].HIcon + "',"); |
| | | sb.Append("HRowCount=N'" + list[0].HRowCount + "',"); |
| | | sb.Append("HColCount=N'" + list[0].HColCount + "',"); |
| | | sb.Append("HPNLPosition_x=N'" + list[0].HPNLPosition_x + "',"); |
| | | sb.Append("HPNLPosition_y=N'" + list[0].HPNLPosition_y + "',"); |
| | | sb.Append("HModifyMan=N'" + msg4 + "',"); |
| | | sb.Append("HModifyDate=getdate()"); |
| | | sb.Append(" where HInterID=N'" + list[0].HInterID + "'"); |
| | | string sql1 = sb.ToString(); |
| | | oCN.RunProcReturn(sql1, "Gy_PNLInfo"); |
| | | |
| | | oCN.RunProcReturn("Update Gy_PNLInfoSub set HLayOutName = N'" + list[0].HLayOutName + "'" + |
| | | " where HInterID=N'" + list[0].HInterID + "'", "Gy_PNLInfoSub"); |
| | | sb.Clear(); |
| | | // æå»ºå é¤ æ´æ°è¯å¥ |
| | | List<string> HUpdateLangList = new List<string>(); |
| | | int batchNum = 100; |
| | | |
| | | HashSet<string> HSetNoHashSet = new HashSet<string>(); |
| | | HashSet<string> HPCSNoHashSet = new HashSet<string>(); |
| | | |
| | | foreach( var lsone in lsmain) |
| | | { |
| | | |
| | | batchNum--; |
| | | |
| | | if (HPCSNoHashSet.Contains(lsone.HPCSNo) == true) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "PCSç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | HSetNoHashSet.Add(lsone.HSetNo); |
| | | HPCSNoHashSet.Add(lsone.HPCSNo); |
| | | if (lsone.HEntryID != 0) |
| | | { |
| | | delEntryIDList.Add(lsone.HEntryID); |
| | | } |
| | | sb.Append("insert into Gy_PNLInfoSub(HInterID,"); |
| | | sb.Append("HLayOutName, HSetNo, HPCSNo, HPosition_x, HPosition_y" + |
| | | ",HSetPosition_y, HSetPosition_x ) values( "); |
| | | sb.Append("N'" + lsone.HInterID + "',"); |
| | | sb.Append("N'" + lsone.HLayOutName + "',"); |
| | | sb.Append("N'" + lsone.HSetNo + "',"); |
| | | sb.Append("N'" + lsone.HPCSNo + "',"); |
| | | sb.Append("N'" + lsone.HPosition_x + "',"); |
| | | sb.Append("N'" + lsone.HPosition_y + "',"); |
| | | sb.Append("N'" + lsone.HSetPosition_y + "',"); |
| | | sb.Append("N'" + lsone.HSetPosition_x + "'"); |
| | | sb.Append(");"); |
| | | |
| | | |
| | | if (batchNum == 0) |
| | | { |
| | | HUpdateLangList.Add(sb.ToString()); |
| | | sb.Clear(); |
| | | batchNum = 100; |
| | | } |
| | | } |
| | | |
| | | HUpdateLangList.Add(sb.ToString()); |
| | | sb.Clear(); |
| | | |
| | | |
| | | // å表å é¤ |
| | | string delWhereStr = "(" + string.Join(",", delEntryIDList.ToArray()) + ")"; |
| | | string sql2 = "Delete from Gy_PNLInfoSub where HEntryID in " + delWhereStr; |
| | | LogService.Write("æ§è¡SQLè¯å¥ï¼" + sql2); |
| | | oCN.RunProcReturn(sql2, "Gy_PNLInfoSub"); |
| | | |
| | | |
| | | // å¢å å夿 å½åéè¦æ°å¢çæ°æ®ä¸æ¯å¦æPCSç åSETç éå¤çé¨å |
| | | string HSetNoInStr = "(" + string.Join(",", HSetNoHashSet.ToArray<string>()) + ")"; |
| | | string HPCSNoInStr = "(" + string.Join(",", HPCSNoHashSet.ToArray<string>()) + ")"; |
| | | |
| | | // 夿æ¯å¦æsetç æè
PCSç éå¤çé¨å |
| | | ds = oCN.RunProcReturn("select top 1 HEntryID from Gy_PNLInfoSub where HSetNo in " + HSetNoInStr |
| | | + " AND HPCSNo in " + HPCSNoInStr + "and HInterID = " + list[0].HInterID , "Gy_PNLInfoSub"); |
| | | LogService.Write("æ§è¡ SQL è¯å¥: select top 1 HEntryID from Gy_PNLInfoSub where HSetNo in " + HSetNoInStr |
| | | + " AND HPCSNo in " + HPCSNoInStr + "and HInterID = " + list[0].HInterID); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "setç åPCSç æéå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | // å表 æ°å¢ |
| | | HUpdateLangList.ForEach(HUpdateLang => |
| | | { |
| | | ds = oCN.RunProcReturn(HUpdateLang, "Gy_PNLInfoSub"); |
| | | } |
| | | ); |
| | | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterSaveCtrl " + msg4 + ",'2'", "h_p_Gy_PNLInfo_AfterSaveCtrl"); |
| | | if (ds_editCheck == null) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds_editCheck.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸PNLå¸å± |
| | | [Route("Gy_PNLInfoController/CheckBill")] |
| | | [HttpGet] |
| | | public object CheckBill(int HInterID, string user, int IsAudit) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfo_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select top 1 HCheckMan from Gy_PNLInfo where HInterID=" + HInterID, "Gy_PNLInfo"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["HCheckMan"].ToString()) != true) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["HCheckMan"].ToString()) == true) |
| | | { |
| | | 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_PNLInfo_BeforeCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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_PNLInfo set HCheckMan='" + user + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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_PNLInfo_BeforeUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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_PNLInfo set HCheckMan='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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; |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç¦ç¨PNLå¸å± |
| | | [Route("Gy_PNLInfoController/StopBill")] |
| | | [HttpGet] |
| | | public object StopBill(int HInterID, string user, int IsStop) |
| | | { |
| | | try |
| | | { |
| | | //ç¦ç¨æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfo_Stop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select top 1 HStopMan from Gy_PNLInfo where HInterID=" + HInterID, "Gy_PNLInfo"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopMan"].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_PNLInfo_BeforeStopCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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_PNLInfo set HStopMan='" + user + "',HStopDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | //ç¦ç¨åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterStopCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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_PNLInfo_BeforeUnStopCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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_PNLInfo set HStopMan='',HStopDate=null where HInterID=" + HInterID); |
| | | |
| | | |
| | | //åç¦ç¨åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfo_AfterUnStopCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_PNLInfo_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 |
| | | } |
| | | } |