| | |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg3 = sArray[2].ToString(); |
| | | string msg4 = sArray[1].ToString();//å表 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<WorkStation> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<WorkStation>>(msg2); |
| | | List<WorkStationSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<WorkStationSub>>(msg4); |
| | | |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | long HCREATEORGID = list[0].HCREATEORGID; |
| | | |
| | | |
| | | |
| | | #region [注é代ç ] |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log("Gy_Warehouse_Edit", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | #region [注é代ç ] |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log("Gy_Warehouse_Edit", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | #endregion |
| | | //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | #endregion |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | //å¤æä»£ç æ¯å¦éå¤ |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("Insert into Gy_WorkStation " + |
| | | DataSet ds = oCN.RunProcReturn("Insert into Gy_WorkStation " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark," + |
| | | "HUSEORGID,HCREATEORGID,HMakeEmp,HMakeTime) " + |
| | | "HUSEORGID,HCREATEORGID,HMakeEmp,HMakeTime) output inserted.HItemID" +//è·ååææå
¥çèªå¢ID |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + |
| | | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HUSEORGID + ",'" + HCREATEORGID + "','" + msg3 + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HUSEORGID + ",'" + HCREATEORGID + "','" + msg3 + "',getdate())", "Gy_WorkStation"); |
| | | int HInterID = Convert.ToInt32(ds.Tables[0].Rows[0]["HItemID"]);//èªå¢ID |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_WorkStation set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å é¤å表 |
| | | oCN.RunProc("Delete From " + "Gy_WorkStationSub" + " where HInterID=" + HInterID); |
| | | |
| | | //æå
¥å表 |
| | | if (subList != null && subList.Count > 0) |
| | | { |
| | | int i = 0; |
| | | foreach (Models.WorkStationSub oSub in subList) |
| | | { |
| | | |
| | | if (oSub == null) |
| | | continue; |
| | | i++; |
| | | string subSql = "insert into Gy_WorkStationSub" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HMaterID" + ")" + |
| | | " values(" + |
| | | HInterID + "," + |
| | | (i) + "," + |
| | | (oSub.HSourceInterID != 0 ? oSub.HSourceInterID.ToString() : "0") + "," + |
| | | ( oSub.HSourceEntryID != 0 ? oSub.HSourceEntryID.ToString() : "0") + ",'" + |
| | | (oSub.HSourceBillNo ?? "") + "','" + (oSub.HSourceBillType ?? "") + "'," + |
| | | (oSub.HMaterID != 0 ? oSub.HMaterID.ToString() : "0") + |
| | | ")"; |
| | | |
| | | oCN.RunProc(subSql); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_WorkStation set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | //å é¤å表 |
| | | oCN.RunProc("Delete From " + "Gy_WorkStationSub" + " where HInterID=" + HItemID); |
| | | |
| | | //æå
¥å表 |
| | | if (subList != null && subList.Count > 0) |
| | | { |
| | | int i = 0; |
| | | foreach (Models.WorkStationSub oSub in subList) |
| | | { |
| | | |
| | | if (oSub == null) |
| | | continue; |
| | | i++; |
| | | string subSql = "insert into Gy_WorkStationSub" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HMaterID" + ")" + |
| | | " values(" + |
| | | HItemID + "," + |
| | | (i) + "," + |
| | | (oSub.HSourceInterID != 0 ? oSub.HSourceInterID.ToString() : "0") + "," + |
| | | (oSub.HSourceEntryID != 0 ? oSub.HSourceEntryID.ToString() : "0") + ",'" + |
| | | (oSub.HSourceBillNo ?? "") + "','" + (oSub.HSourceBillType ?? "") + "'," + |
| | | (oSub.HMaterID != 0 ? oSub.HMaterID.ToString() : "0") + |
| | | ")"; |
| | | |
| | | oCN.RunProc(subSql); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region æ ¹æ®åºç¡èµæ ID æ æ¡ç æ¥æ¾è®°å½ |
| | | [Route("Gy_WorkStationBill/cx1")] |
| | | [HttpGet] |
| | | public object cx(long HInterID = -1, string HBarCode = "-1") |
| | | { |
| | | try |
| | | { |
| | | if(HInterID != -1) |
| | | { |
| | | return cx(HInterID); |
| | | } |
| | | |
| | | if(HBarCode != "-1") |
| | | { |
| | | ds = oCN.RunProcReturn($"select * from h_v_Gy_WorkStationEdit where å·¥ä½ä»£ç ='{HBarCode}'", "h_v_Gy_WorkStationList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | }else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | 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 æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | [Route("Gy_WorkStationBill/cx")] |
| | | [HttpGet] |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkStationList where HitemID=" + HInterID, "h_v_Gy_WorkStationList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkStationEdit where HitemID=" + HInterID, "h_v_Gy_WorkStationList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |