| | |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¹éæ·»å QC_CheckNote_PNL_Temp |
| | | [Route("QC_CheckNote_PNL_TempController/BatchAddBill")] |
| | | [HttpPost] |
| | | public object BatchAddBill([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();//å½å人 |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("QC_CheckNote_PNL_Temp_Edit", 1, false, msg3)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æä¿®æ¹æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //ååºåå |
| | | //msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Models.ClsQC_CheckNote_PNL_Temp> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsQC_CheckNote_PNL_Temp>>(msg2); |
| | | |
| | | oCN.BeginTran(); |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | int HItemID = list[i].HItemID; |
| | | string HBarCode = list[i].HBarCode; |
| | | string HSetNo = list[i].HSetNo; |
| | | string HPCSNo = list[i].HPCSNo; |
| | | int HPosition_x = list[i].HPosition_x; |
| | | int HPosition_y = list[i].HPosition_y; |
| | | string HCheckProc = list[i].HCheckProc; |
| | | string HPageIndex = list[i].HPageIndex; |
| | | string HBadReason = list[i].HBadReason; |
| | | string HMaker = list[i].HMaker; |
| | | DateTime HMakeDate = list[i].HMakeDate; |
| | | |
| | | DataSet ds_editCheck; |
| | | //ä¿ååæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_QC_CheckNote_PNL_Temp_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_QC_CheckNote_PNL_Temp_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.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.Append("Insert Into QC_CheckNote_PNL_Temp(HBarCode, HSetNo, HPCSNo, HPosition_x,HPosition_y,HCheckProc,HPageIndex ,HBadReason, HMaker, HMakeDate) Values("); |
| | | sb.Append("N'" + HBarCode + "',"); |
| | | sb.Append("N'" + HSetNo + "',"); |
| | | sb.Append("N'" + HPCSNo + "',"); |
| | | sb.Append("N'" + HPosition_x + "',"); |
| | | sb.Append("N'" + HPosition_y + "',"); |
| | | sb.Append("N'" + HCheckProc + "',"); |
| | | sb.Append("N'" + HPageIndex + "',"); |
| | | sb.Append("N'" + HBadReason + "',"); |
| | | sb.Append("N'" + HMaker + "',"); |
| | | sb.Append("N'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')"); |
| | | string sql = sb.ToString(); |
| | | sb.Clear(); |
| | | ds = oCN.RunProcReturn(sql, "QC_CheckNote_PNL_Temp"); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | ds_editCheck = oCN.RunProcReturn("Exec h_p_QC_CheckNote_PNL_Temp_AfterSaveCtrl " + msg3 + ",'1'", "h_p_QC_CheckNote_PNL_Temp_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 å é¤QC_CheckNote_PNL_Temp |
| | | [Route("QC_CheckNote_PNL_TempController/DeleteBill")] |
| | | [HttpGet] |