| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | |
| | | } |
| | | return ordrlist; |
| | | } |
| | | |
| | | |
| | | |
| | | public object HSourceOrderList1(DataTable dt, HSouceOrderList ordrlist, string HBarCodeType,string HSourceBillType) |
| | | { |
| | |
| | | ",@HFactory = N'" + HFactory + "'" + |
| | | ",@HCoilNO = N'" + HCoilNO + "'" + |
| | | ",@HFurnaceNO = N'" + HFurnaceNO + "'" + |
| | | ",@HInnerBillNo = N'" + ordrlist[0].HInnerBillNo + "'" |
| | | ",@HInnerBillNo = N'" + ordrlist[0].HInnerBillNo + "'" + |
| | | ",@HSourceBillType = N'" + ordrlist[0].HBillType + "'" + |
| | | ",@HStockOrg = N'" + HOrgType + "'" + |
| | | ",@HInterID = N'" + ordrlist[0].HInterID + "'" |
| | | , "h_p_SC_BarCode_Transfer"); |
| | | if((bool)ds1.Tables[0].Rows[0]["returntype"] == true) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¡ç è½¬åæ¡ç 主档(æ¹é) |
| | | /// <summary> |
| | | /// æ¡ç è½¬åæ¡ç 主档(æ¹é) |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("Sc_BarCode/SaveBarCode_NoGenerate_Batch")] |
| | | [HttpPost] |
| | | public object SaveBarCode_NoGenerate_Batch([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.None); |
| | | string msg2 = sArray[0].ToString(); |
| | | string HOrgType = sArray[1].ToString(); |
| | | string HSourceBillTypeName = sArray[2].ToString(); |
| | | string HSelectBarCodeType = sArray[3].ToString(); |
| | | string CampanyName = sArray[4].ToString() == "xxx" ? "" : sArray[4].ToString(); |
| | | string UserName = sArray[5].ToString(); |
| | | string barCodeNoStrs = sArray[6].ToString(); // è¿éçæ¡ç æ¯ä¸æäº¤çåæ®åºå对åºçæ¡ç æ°ç» |
| | | string HFactory = sArray[7].ToString(); |
| | | string HCoilNO = sArray[8].ToString(); |
| | | string HFurnaceNO = sArray[9].ToString(); |
| | | ClsPub.CurUserName = UserName; |
| | | |
| | | //è·åå
ç |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | HOrgNumber = ""; |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(HOrgType)) |
| | | { |
| | | HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | HOrgNumber = DBUtility.ClsPub.isStrNull(oClsGy_ORGANIZATIONS_View.omodel.HNumber); |
| | | } |
| | | if (HOrgID == -1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-055]éæ©ç»ç»æé误!"; |
| | | return objJsonResult; |
| | | } |
| | | if (!Sub_AllowSave(msg2, HSelectBarCodeType))//忮宿´æ§å¤æ |
| | | { |
| | | return objJsonResult; |
| | | } |
| | | if (HSelectBarCodeType == "ä»ªå¨æåæ¡ç è§å") |
| | | { |
| | | //客æ·å®å¶ |
| | | } |
| | | else |
| | | { |
| | | string HBarCodeType = ClsPub.isStrNull(HSelectBarCodeType); |
| | | // æ¡ç 转å |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | List<HSouceOrderList> ordrlist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HSouceOrderList>>(msg2); |
| | | List<string> barcodeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(barCodeNoStrs); |
| | | // TODO éè¿InterID å EntryID 仿¡ç æ¡£æ¡ä¸æ¥è¯¢æ¯å¦æå·²çæçåæ® éæ°åä¸ä¸ªåå¨è¿ç¨ï¼å½å·²åå¨å¯¹åºçæ¡ç åæ®æ¶ï¼è¿åæ¡ç 主档ä¸çæ¡ç æ¡£æ¡ |
| | | DataSet dsCache = oCN.RunProcReturn($@"select * from h_v_IF_BarCodeBillList a |
| | | Inner Join Gy_BarCodeBill b on a.HItemID = b.HItemID |
| | | where b.HSourceINterID = { ordrlist[0].HMainID } and b.HSourceEntryID = {ordrlist[0].HSubID}" |
| | | , "h_v_IF_BarCodeBillList"); |
| | | if(dsCache.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "2"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.data = dsCache.Tables[0]; |
| | | objJsonResult.Message = "æ¡ç å·²åå¨!"; |
| | | return objJsonResult; |
| | | } |
| | | DataSet ds1 = new DataSet(); |
| | | for(int i=0; i<ordrlist.Count; i++) |
| | | { |
| | | |
| | | long HSourceInterID = string.IsNullOrEmpty(ordrlist[i].HMainID) == true ? 0 : ClsPub.isLong(ordrlist[0].HMainID); |
| | | long HSourceEntryID = string.IsNullOrEmpty(ordrlist[i].HSubID) == true ? 0 : ClsPub.isLong(ordrlist[0].HSubID); |
| | | |
| | | ds1 = oCN.RunProcReturn("exec h_p_SC_BarCode_Transfer " + |
| | | "@HBarCodeNo = N'" + barcodeList[i] + "'" + |
| | | ",@HSubID = " + ordrlist[i].HSubID + |
| | | ",@HMaterID = " + ordrlist[i].HMaterID + |
| | | ",@HGiveAwayFlag = " + ordrlist[i].HGiveAwayFlag + |
| | | ",@HQty = " + ordrlist[i].HQty + |
| | | ",@HUnitID = " + ordrlist[i].HUnitID + |
| | | ",@HMinQty = " + ordrlist[i].HMinQty + |
| | | ",@HSupID = " + ordrlist[i].HSupID + |
| | | ",@HBatchNo = N'" + ordrlist[i].HBatchNo + "'" + |
| | | ",@HMTONO = N'" + ordrlist[i].HMTONo + "'" + |
| | | ",@HBarCodeDate = N'" + ordrlist[i].HDate + "'" + |
| | | ",@HEmpID = " + ordrlist[i].HEmpID + |
| | | ",@HSourceInterID = " + HSourceInterID + |
| | | ",@HSourceEntryID = " + HSourceEntryID + |
| | | ",@HBarCodeType = N'" + HBarCodeType + "'" + |
| | | ",@HSourceBillNo = N'" + ordrlist[i].HSourceBillNo + "'" + |
| | | ",@HMaker = N'" + ordrlist[i].HMaker + "'" + |
| | | ",@HFactory = N'" + HFactory + "'" + |
| | | ",@HCoilNO = N'" + HCoilNO + "'" + |
| | | ",@HFurnaceNO = N'" + HFurnaceNO + "'" + |
| | | ",@HInnerBillNo = N'" + ordrlist[i].HInnerBillNo + "'" + |
| | | ",@HSourceBillType = N'" + ordrlist[i].HBillType + "'" + |
| | | ",@HStockOrg = N'" + HOrgType + "'" + |
| | | ",@HInterID = " + ordrlist[i].HInterID |
| | | , "h_p_SC_BarCode_Transfer"); |
| | | if ((bool)ds1.Tables[0].Rows[0]["returntype"] == false) |
| | | { |
| | | throw new Exception(ds1.Tables[0].Rows[0]["mesg"].ToString()); |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ds1.Tables[0].Rows[0]["mesg"].ToString(); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3899-2-006]æ¡ç çæå¤±è´¥!" + e.Message; |
| | | return objJsonResult; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [è·åæ ç¾æå°æä»¤ CPCLæä»¤] |
| | | [Route("Sc_BarCode/Get_BarCodePrintCode_CPCL")] |
| | | [HttpGet] |
| | | public object Get_BarCodePrintCode_CPCL(string HOrginationName, int HBillInterID, int HBillEntryID, string HViewName, string HBillSubType, int HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_getHBarCodePrintCode_CPCL N'" + HOrginationName + "'" + |
| | | "," + HBillInterID + "," + HBillEntryID + ",N'" + HViewName + "',N'" + HBillSubType + "'," + HInterID, "h_p_getHBarCodePrintCode_CPCL"); |
| | | if((int)ds.Tables[0].Rows[0]["resultType"] == 1) |
| | | { |
| | | string resultMesg = ds.Tables[0].Rows[0]["payload"].ToString().Replace("\\r\\n", "\r\n"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = resultMesg; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æå°æä»¤è·å失败!" + ds.Tables[0].Rows[0]["payload"]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æå°æä»¤è·å失败!" + e.Message; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [APP è·åæå°æ¨¡æ¿] |
| | | public class PrintTemplate |
| | | { |
| | | public int Id { get; } |
| | | public string OrgShort { get; } |
| | | public string HBillSubtype { get; } |
| | | public string Format { get; } |
| | | public string Description { get; } |
| | | public string[] Placeholder { get; } |
| | | } |
| | | |
| | | [Route("Sc_BarCode/Get_BarCodeGenTemplate")] |
| | | [HttpGet] |
| | | public object Get_BarCodeGenTemplate(string HOrginationName, string HBillSubType) |
| | | { |
| | | try |
| | | { |
| | | |
| | | string filePath = HttpContext.Current.Server.MapPath("~/Template"); |
| | | string fileFullPath = Path.Combine(filePath, "barCodeTemplateStorage.json"); |
| | | |
| | | if (!File.Exists(fileFullPath)) |
| | | { |
| | | |
| | | throw new Exception($"æ¨¡æ¿æä»¶ä¸åå¨ï¼{fileFullPath}"); |
| | | } |
| | | |
| | | string jsonContent = File.ReadAllText(fileFullPath); |
| | | var templates = JsonConvert.DeserializeObject<PrintTemplate[]>(jsonContent); |
| | | |
| | | var targetTemplate = templates.FirstOrDefault<PrintTemplate>(t => HOrginationName.Contains(t.OrgShort) && string.Equals(t.HBillSubtype, HBillSubType)); |
| | | if (targetTemplate != null) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.data = JsonConvert.SerializeObject(targetTemplate); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"æ²¡ææ¾å°å¯¹åºç模æ¿"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æå°æ¨¡æ¿è·å失败!" + e.Message; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | //å¢å æ¡ç è¶
è¿æªçæåè½æ§å¶ |
| | | |
| | | // |
| | | //èªå¨è£
ç®± |
| | | string sql_autoForBoxBill = "exec h_v_Gy_BarCode_AutoProductBarCodeBox " + HInterID.ToString(); |
| | | oCN.RunProc(sql_autoForBoxBill); |
| | | |
| | | oCN.Commit(); |
| | | List<Object> listobj = ListRows.ConvertAll(s => (object)s);//Listå®ä½ç±»è½¬æ¢ä¸ºobject |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [app æ¡ç æç è·ååæ¡ç ] |
| | | [Route("Sc_BarCode/SplitBarCode_Sub")] |
| | | [HttpGet] |
| | | public object SplitBarCode_Sub(string HBarCodeNo) |
| | | { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //æ¥è¯¢æ¡ç ä¿¡æ¯ |
| | | if (HBarCodeNo != null) |
| | | { |
| | | string prefix = HBarCodeNo.Trim() + "-"; |
| | | |
| | | ds = oCn.RunProcReturn("SELECT * FROM h_v_Gy_SplitBarCode WITH(NOLOCK) WHERE HBarCode LIKE '" + prefix + "' + '%' AND HBarCode NOT LIKE '" + prefix + "' + '%-%' AND ISNUMERIC(RIGHT(HBarCode, LEN(HBarCode) - LEN( '" + prefix + "' ))) = 1 AND TRY_CAST(RIGHT(HBarCode, LEN(HBarCode) - LEN( '" + prefix + "' )) AS INT) IS NOT NULL ", "Gy_BarCodeBill"); |
| | | if (ds != null || ds.Tables[0].Rows.Count >= 0) |
| | | { |
| | | // æ¾åºæå¤§åç¼æ°åï¼ç¨äºçæä¸ä¸ä¸ªç¼å· |
| | | int maxSuffix = 0; |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | { |
| | | string barCode = row["HBarCode"].ToString(); |
| | | string suffixPart = barCode.Substring(prefix.Length); // å - åçé¨å |
| | | if (int.TryParse(suffixPart, out int num)) |
| | | { |
| | | if (num > maxSuffix) maxSuffix = num; |
| | | } |
| | | } |
| | | |
| | | // çæä¸ä¸ä¸ªåç ç¼å· |
| | | string nextBarCode = $"{HBarCodeNo}-{maxSuffix + 1}"; |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = new |
| | | { |
| | | SubBarCodes = ds.Tables[0], // æ¡ç åºç¡ä¿¡æ¯ |
| | | NextBarCode = nextBarCode // ä¸ä¸ä¸ªçæçæ¡ç |
| | | }; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) //æåºå¼å¸¸ |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [appæ¡ç æç çæ] |
| | | [Route("Sc_BarCode/SplitBarCode_Save")] |
| | | [HttpPost] |
| | | public object SplitBarCode_Save([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | ListModels oListModels = new ListModels(); |
| | | DAL.ClsGy_BarCodeBill_ChaiMa BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa(); |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string barcode = sArray[0].ToString(); //æ¡ç ç¼å· |
| | | Double splitnum = Convert.ToDouble(sArray[1]); //æç æ°é |
| | | string data = sArray[2].ToString(); //è¡¨ä½æ°æ® |
| | | string user = sArray[3].ToString(); //ç¨æ·å |
| | | |
| | | data = data.Replace("\\", ""); |
| | | data = data.Replace("\n", ""); //\n |
| | | |
| | | List<Model.ClsGy_BarCodeEdit_Model> lsmain = new List<Model.ClsGy_BarCodeEdit_Model>(); |
| | | lsmain = oListModels.getObjectByJson_Gy_SplitBarCode(data); |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | ds = oCN.RunProcReturn("select top 1 * from Gy_BarCodeBill where HBarCode='" + barcode + "'", "Gy_BarCodeBill"); |
| | | |
| | | if (ds != null || ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | |
| | | string sql = "insert into Gy_BarCodeBill (HInterID, HEntryID, HBarCode, HBarCodeType, HBarCodeSubType, HMaterID, HUnitID, HQty, HBatchNo, HSupID, HGroupID, HMaker, HMakeDate, " + |
| | | "HPrintQty, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType, HinitQty, HEndQty, HBarcodeQtys, HBarcodeNo, HDeptID, HWhID, HSPID, HRemark, " + |
| | | "HCusID, HCusType, HEndDate, HWorkLineName, HBarCodeDate, HSTOCKORGID, HOWNERID, HSeOrderBillNo, HGiveAwayFlag, HMaterName, HMaterModel, " + |
| | | "HPinfan, HAuxPropID, HMTONo, HInnerBillNo, HCoilNO, HFurnaceNO, HFactory, HAuxQty, HheatNO, HProduceDate, HExpiryDate, HEmpID, HCusModel, HCusMaterName, HCheckEmpName, HZZRQ" + |
| | | ") values (" + |
| | | "'" + ds.Tables[0].Rows[0]["HInterID"].ToString() + "', " + |
| | | "'" + (int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1).ToString() + "', " + |
| | | "'" + lsmain[0].HBarCode.ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HBarCodeType"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HBarCodeSubType"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HMaterID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HUnitID"].ToString() + "', " + |
| | | "'" + splitnum + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HBatchNo"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSupID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HGroupID"].ToString() + "', " + |
| | | "'" + user + "', getdate(), " + |
| | | "'" + ds.Tables[0].Rows[0]["HPrintQty"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSourceInterID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSourceEntryID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSourceBillNo"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSourceBillType"].ToString() + "', " + |
| | | "'" + splitnum + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HEndQty"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HBarcodeQtys"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HBarcodeNo"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HDeptID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HWhID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSPID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HRemark"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HCusID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HCusType"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HEndDate"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HWorkLineName"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HBarCodeDate"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSTOCKORGID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HOWNERID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HSeOrderBillNo"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HGiveAwayFlag"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HMaterName"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HMaterModel"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HPinfan"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HAuxPropID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HMTONo"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HInnerBillNo"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HCoilNO"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HFurnaceNO"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HFactory"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HAuxQty"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HheatNO"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HProduceDate"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HExpiryDate"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HEmpID"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HCusModel"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HCusMaterName"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HCheckEmpName"].ToString() + "', " + |
| | | "'" + ds.Tables[0].Rows[0]["HZZRQ"].ToString() + "'" + |
| | | ")"; |
| | | //æå
¥æåæ¡ç |
| | | oCN.RunProc(sql); |
| | | //æ´æ°èæ¡ç çHQtyæ°é |
| | | oCN.RunProc("update Gy_BarCodeBill set HQty= HQty-'"+splitnum+"' where HItemID="+ ds.Tables[0].Rows[0]["HItemID"].ToString()); |
| | | |
| | | |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æªæ¥è¯¢å°æ¡ç ä¿¡æ¯"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | } |
| | | } |