New file |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using System.Web; |
| | | //using WebAPI.Controllers.SCGL.æ¥è®¡å管ç; |
| | | using System.IO; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Gy_PNLInfoTypeLevelController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | Models.ClsGy_DotCheck oDept = new Models.ClsGy_DotCheck(); |
| | | Models.ClsGy_DotCheck oDeptHlp = new Models.ClsGy_DotCheck(); |
| | | |
| | | #region å±çº§åè¡¨æ°æ® |
| | | [Route("Gy_PNLInfoTypeLevelController/GetPNLInfoTypeLevel")] |
| | | [HttpGet] |
| | | public object GetPNLInfoTypeLevel(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfoTypeLevel", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_PNLInfoTypeSub where 1=1 " + sWhere + " order by å±çº§ä»£ç ", "h_v_Gy_PNLInfoTypeSub"); |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å±çº§é¡¹ç®å é¤ |
| | | [Route("Gy_PNLInfoTypeLevelController/DeleteType")] |
| | | [HttpGet] |
| | | public object DeleteType(long HInterID, string User) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfoTypeLevel_Delete", 1, false, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("Select * from Gy_PNLInfoTypeSub Where HInterID='" + HInterID + "'", "Gy_PNLInfoTypeSub", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | //ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeDelCtrl " + HInterID + ",'" + User + "'", "h_p_Gy_DotCheck_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; |
| | | //} |
| | | //========================================================= |
| | | |
| | | ds = oCN.RunProcReturn("Delete from Gy_PNLInfoTypeSub Where HInterID='" + HInterID + "'", "Gy_PNLInfoTypeSub", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterDelCtrl " + HInterID + ",'" + User + "'", "h_p_Gy_DotCheck_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 = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹å±çº§è·åç»å®æ°æ® |
| | | [Route("Gy_PNLInfoTypeLevelController/EditType")] |
| | | [HttpGet] |
| | | public object EditType(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_PNLInfoTypeSub where HInterID=" + HInterID, "Gy_PNLInfoTypeSub"); |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç¹æ£é¡¹ç®ä¿®æ¹ä¿å |
| | | [Route("Gy_PNLInfoTypeLevelController/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject msg) |
| | | { |
| | | |
| | | try |
| | | { |
| | | 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(); |
| | | string msg2 = msg3.ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Models.ClsGy_PNLTypeLevel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_PNLTypeLevel>>(msg2); |
| | | |
| | | int HNumber = list[0].HInterID; |
| | | int HEntryID = list[0].HEntryID; |
| | | string HPageIndex = list[0].HPageIndex; |
| | | string HColorStr = list[0].HColorStr; |
| | | string HLayerNo = list[0].HLayerNo; |
| | | |
| | | //夿æé |
| | | //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | |
| | | |
| | | ////ä¿ååæ§å¶========================================= |
| | | //DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_BeforeSaveCtrl"); |
| | | //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_PNLInfoTypeSub set " + |
| | | "HPageIndex='" + HPageIndex + "'" + |
| | | ", HColorStr='" + HColorStr + "'" + |
| | | ", HLayerNo='" + HLayerNo + "'" + |
| | | " Where HInterID='" + HNumber + "'", |
| | | ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_AfterSaveCtrl"); |
| | | //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(ds2.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 å±çº§é¡¹ç®æ°å¢ä¿å |
| | | [Route("Gy_PNLInfoTypeLevelController/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | 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(); |
| | | string msg2 = msg3.ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | |
| | | List<Models.ClsGy_PNLTypeLevel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_PNLTypeLevel>>(msg2); |
| | | |
| | | int HNumber = list[0].HInterID; |
| | | int HEntryID = list[0].HEntryID; |
| | | string HPageIndex = list[0].HPageIndex; |
| | | string HColorStr = list[0].HColorStr; |
| | | string HLayerNo = list[0].HLayerNo; |
| | | |
| | | //夿æé |
| | | //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | //DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_BeforeSaveCtrl"); |
| | | //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("Insert into Gy_PNLInfoTypeSub " + |
| | | " (HInterID,HEntryID,HPageIndex,HColorStr,HLayerNo" + |
| | | " ) " + |
| | | " Values(" + HNumber + "," + HEntryID + ",'" + HPageIndex + "','" + HColorStr + "','" + |
| | | HLayerNo + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_AfterSaveCtrl"); |
| | | //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(ds2.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 å±çº§å表 æ ç¶å¾ ç¹å»åç±»æ¥è¯¢ |
| | | public class TreeModel |
| | | { |
| | | public string id { get; set; } |
| | | public string title { get; set; } |
| | | public List<TreeModel> children = new List<TreeModel>(); |
| | | } |
| | | [Route("Gy_PNLInfoTypeLevelController/TreeGetList")] |
| | | [HttpGet] |
| | | public object TreeGetList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select HInterID,HName from Gy_PNLInfoType", "Gy_PNLInfoType"); |
| | | |
| | | List<TreeModel> treeModels = new List<TreeModel>(); |
| | | TreeModel first = new TreeModel(); |
| | | first.id = "0"; |
| | | first.title = "å±çº§é¡¹ç®å类设置"; |
| | | treeModels.Add(first); |
| | | |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | { |
| | | var strLen = row["HInterID"].ToString().Split('.'); |
| | | if (strLen.Length == 1) |
| | | { |
| | | TreeModel tree = new TreeModel(); |
| | | tree.id = row["HInterID"].ToString(); |
| | | tree.title = row["HName"].ToString(); |
| | | treeModels[0].children.Add(tree); |
| | | } |
| | | } |
| | | //digui(ds.Tables[0], treeModels[0].children, 2); |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | //#region ç¹æ£é¡¹ç®æä»¶ä¸ä¼ |
| | | //[Route("Gy_DotCheck/Gy_DotCheck_Excel")] |
| | | //[HttpPost] |
| | | //public object Gy_DotCheck_Excel() |
| | | //{ |
| | | // try |
| | | // { |
| | | // //è·åæä»¶åç§° |
| | | // var file = HttpContext.Current.Request.Files[0]; |
| | | // //è·åæä»¶ç©çè·¯å¾ |
| | | // string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName); |
| | | // //ä¿åæä»¶ |
| | | // file.SaveAs(ExcelPath); |
| | | |
| | | // NpoiHelper np = new NpoiHelper(); |
| | | // DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0"); |
| | | |
| | | // //å 餿件 |
| | | // File.Delete(ExcelPath); |
| | | |
| | | // //å建临æ¶è¡¨ |
| | | // DataTable tb2 = new DataTable("dt2"); |
| | | |
| | | // //æ·»å åå |
| | | // for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++) |
| | | // { |
| | | // tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString()); |
| | | // } |
| | | |
| | | // //模æ¿ç¼ºå°å ä½éè¦ä»æ°æ®åºä¸æ¥è¯¢åºæ¥æ¾ç¤ºå¨é¡µé¢çåæ®µ |
| | | // tb2.Columns.Add("HOrgID", typeof(Int32));//ç»ç»ID |
| | | // tb2.Columns.Add("HDotCheckItemClassID", typeof(Int32));//ç¹æ£é¡¹ç®åç±»ID |
| | | |
| | | // //æ·»å æ°æ® |
| | | // for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++) |
| | | // { |
| | | // DataRow row = tb2.NewRow(); |
| | | // for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++) |
| | | // { |
| | | // row[j] = ExcelDs.Tables[0].Rows[i][j].ToString(); |
| | | // } |
| | | // tb2.Rows.Add(row); |
| | | // } |
| | | |
| | | |
| | | // var error = ""; |
| | | |
| | | // //æ¥è¯¢å·¥ä½ä¸å¿æ²¡æçå |
| | | // if (!tb2.Columns.Contains("ç»ç»ä»£ç ")) |
| | | // error += "æ²¡ææ¾å°ãç»ç»ä»£ç ãçæ é¢,"; |
| | | |
| | | // if (!tb2.Columns.Contains("ç»ç»åç§°")) |
| | | // error += "æ²¡ææ¾å°ãç»ç»åç§°ãçæ é¢,"; |
| | | |
| | | // if (!tb2.Columns.Contains("ç¹æ£é¡¹ç®ä»£ç ")) |
| | | // error += "æ²¡ææ¾å°ãç¹æ£é¡¹ç®ä»£ç ãçæ é¢,"; |
| | | |
| | | // if (!tb2.Columns.Contains("ç¹æ£é¡¹ç®åç§°")) |
| | | // error += "æ²¡ææ¾å°ãç¹æ£é¡¹ç®åç§°ãçæ é¢,"; |
| | | |
| | | // if (!tb2.Columns.Contains("ç¹æ£é¡¹ç®å类代ç ")) |
| | | // error += "æ²¡ææ¾å°ãç¹æ£é¡¹ç®å类代ç ãçæ é¢,"; |
| | | |
| | | // if (!tb2.Columns.Contains("ç¹æ£é¡¹ç®åç±»åç§°")) |
| | | // error += "æ²¡ææ¾å°ãç¹æ£é¡¹ç®åç±»åç§°ãçæ é¢,"; |
| | | |
| | | |
| | | // if (error.Length > 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = $"Excel模æ¿åå¨é误,{error}\r\n"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | |
| | | // for (int i = 0; i <= tb2.Rows.Count - 1; i++) |
| | | // { |
| | | |
| | | // string HORGNumber = ""; |
| | | // string HORGName = ""; |
| | | // string HDotCheckNum = ""; |
| | | // string HDotCheckName = ""; |
| | | // string HDotCheckItemClassNum = ""; |
| | | // string HDotCheckItemClassName = ""; |
| | | |
| | | // HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç»ç»ä»£ç "].ToString()); |
| | | // HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç»ç»åç§°"].ToString()); |
| | | // HDotCheckNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç¹æ£é¡¹ç®ä»£ç "].ToString()); |
| | | // HDotCheckName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç¹æ£é¡¹ç®åç§°"].ToString()); |
| | | // HDotCheckItemClassNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç¹æ£é¡¹ç®å类代ç "].ToString()); |
| | | // HDotCheckItemClassName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["ç¹æ£é¡¹ç®åç±»åç§°"].ToString()); |
| | | |
| | | // //æ£æ¥ç»ç» |
| | | // int index = i + 1; |
| | | |
| | | // if (HORGNumber != "") |
| | | // { |
| | | |
| | | |
| | | // //æ¥è¯¢ç»ç» |
| | | // ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS"); |
| | | |
| | | // if (ds.Tables[0].Rows.Count == 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + index + "è¡,ç»ç»ä¸åå¨ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // else |
| | | // { |
| | | // tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | // } |
| | | // string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | |
| | | |
| | | // //æ¥è¯¢ç¹æ£é¡¹ç®åç±» |
| | | // ds = oCN.RunProcReturn("select * from Gy_DotCheckItemClass where HNumber='" + HDotCheckItemClassNum + "' and HUSEORGID=" + HORGid + "", "Gy_Department"); |
| | | |
| | | // if (ds.Tables[0].Rows.Count == 0) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + index + "è¡,该" + HORGName + "ç»ç»,ç¹æ£é¡¹ç®åç±»:" + HDotCheckItemClassName + ",ä¸åå¨ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // else |
| | | // { |
| | | // tb2.Rows[i]["HDotCheckItemClassID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | // } |
| | | |
| | | // //ç¹æ£é¡¹ç®åç§° |
| | | // if (HDotCheckName == "") |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + index + "è¡,ç¹æ£é¡¹ç®åç§°ä¸è½ä¸ºç©ºï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | |
| | | // //ç¹æ£é¡¹ç®ä»£ç |
| | | // if (HDotCheckNum == "") |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + index + "è¡,ç¹æ£é¡¹ç®ä»£ç ä¸è½ä¸ºç©ºï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "第" + index + "è¡,ç»ç»ä»£ç 为空"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // } |
| | | |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = error; |
| | | // objJsonResult.data = tb2; |
| | | // return objJsonResult; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | //#endregion |
| | | |
| | | #region ç¹æ£é¡¹ç® 导å
¥(ä¿å) |
| | | [Route("Gy_DotCheck/Gy_DotCheck_btnSave")] |
| | | [HttpPost] |
| | | public object Gy_DotCheck_btnSave([FromBody] JObject sMainSub) |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { "&å" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string user = sArray[1].ToString(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2); |
| | | List<Dictionary<string, string>> list = new List<Dictionary<string, string>>(); |
| | | |
| | | foreach (JObject item in Excel) |
| | | { |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | foreach (var itm in item.Properties()) |
| | | { |
| | | dic.Add(itm.Name, itm.Value.ToString()); |
| | | } |
| | | list.Add(dic); |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | int i = 1; |
| | | foreach (Dictionary<string, string> item in list) |
| | | { |
| | | string HOrgID = item["HOrgID"].ToString();//ç»ç»ID |
| | | string HDotCheckItemClassID = item["HDotCheckItemClassID"].ToString();//ç¹æ£é¡¹ç®åç±»ID |
| | | string HDotCheckItemClassName = item["ç¹æ£é¡¹ç®å类代ç "].ToString(); |
| | | string HDotCheckItemClassNum = item["ç¹æ£é¡¹ç®åç±»åç§°"].ToString(); |
| | | string HDotCheckName = item["ç¹æ£é¡¹ç®åç§°"].ToString(); |
| | | string HDotCheckNum = item["ç¹æ£é¡¹ç®ä»£ç "].ToString(); |
| | | string sShortNumber; |
| | | sShortNumber = DBUtility.ClsPub.GetShortNumber(HDotCheckNum);//ç代ç |
| | | if (sShortNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | int HEndFlag = 1;//æ«çº§æ å¿ |
| | | int HLevel = DBUtility.ClsPub.GetLevel(HDotCheckNum); //ç级 |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HDotCheckNum.Trim())) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_DotCheck where HNumber='" + HDotCheckNum + "'", "Gy_DotCheck"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | string sql = "insert into Gy_DotCheck(HName,HNumber,HDotCheckItemClassID,HUSEORGID,HCREATEORGID,HShortNumber,HEndFlag,HLevel,HParentID,HStopflag,HRemark,HHelpCode)" + |
| | | $"values('{HDotCheckName}', '{HDotCheckNum}',{HDotCheckItemClassID}, {HOrgID},{HOrgID}, '{sShortNumber}', {HEndFlag},{HLevel},0,0,'','')"; |
| | | oCN.RunProc(sql); |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc(" update Gy_DotCheck set HDotCheckItemClassID=" + HDotCheckItemClassID + " where HNumber='" + HDotCheckNum + "'"); |
| | | } |
| | | |
| | | i++; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "导å
¥æå!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write(e); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç¹æ£é¡¹ç®å®¡æ ¸ãåå®¡æ ¸ |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("Gy_PNLInfoTypeLevelController/AuditGy_DotCheck")] |
| | | [HttpGet] |
| | | public object AuditGy_DotCheck(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfoTypeLevel_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_PNLInfoType where HItemID=" + HInterID, "Gy_PNLInfoTypeSub "); |
| | | 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_PNLInfoType_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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_PNLInfoType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HInterID=" + HInterID); |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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_PNLInfoType_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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_PNLInfoType set HCheckEmp='',HCheckTime=null where HInterID=" + HInterID); |
| | | |
| | | |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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 ç¹æ£é¡¹ç®ç¦ç¨ãåç¦ç¨ |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsStop">ç¦ç¨(0),åç¦ç¨(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("Gy_PNLInfoTypeLevelController/StopGy_DotCheck")] |
| | | [HttpGet] |
| | | public object StopGy_DotCheck(int HInterID, int IsStop, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //ç¦ç¨æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfoTypeLevel_Stop", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_PNLInfoType where HInterID=" + HInterID, "Gy_PNLInfoType"); |
| | | 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_PNLInfoType_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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_PNLInfoType set HStopEmp='" + CurUserName + "',HStopTime=getdate() where HInterID=" + HInterID); |
| | | |
| | | //ç¦ç¨åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AFTERStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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_PNLInfoType_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_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_PNLInfoType set HStopEmp='',HStopTime=null where HInterID=" + HInterID); |
| | | |
| | | |
| | | //åç¦ç¨åæ§å¶========================================= |
| | | DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterUnStop " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterUnStop"); |
| | | 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 |
| | | } |
| | | } |