| | |
| | | using System.Web; |
| | | using System.Web.Services; |
| | | using System.Data.SqlClient; |
| | | using System.Globalization; |
| | | |
| | | namespace CLOUDWEB |
| | | { |
| | |
| | | string HMaterNames = ""; |
| | | string HMaterModels = ""; |
| | | string HMaterIDs = "0"; |
| | | string HISKFPERIOD = "0";// 保质期启用标记 |
| | | string HUnitIDs = "0"; |
| | | |
| | | //查询物料 |
| | | ds = oCn.RunProcReturn("select * from Gy_Material with(nolock) where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs, "Gy_Material"); |
| | | ds = oCn.RunProcReturn("select HUnitID,HItemID,HName,HModel,case HISKFPERIOD when 1 then '1' else '0' end HISKFPERIOD from Gy_Material a with(nolock) where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs + " order by a.HISKFPERIOD desc", "Gy_Material"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | HMaterIDs = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | HMaterNames = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | HMaterModels = ds.Tables[0].Rows[0]["HModel"].ToString(); |
| | | HISKFPERIOD = ds.Tables[0].Rows[0]["HISKFPERIOD"].ToString(); |
| | | HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString(); |
| | | } |
| | | |
| | | DateTime HDate=DateTime.Now;//日期 |
| | | string HProduceDate = "";//生产日期 |
| | | string HExpiryDate = "";//保质期至 |
| | | |
| | | if (str.Length == 8 && HISKFPERIOD == "1") |
| | | { |
| | | if (!string.IsNullOrWhiteSpace(str[7])) |
| | | { |
| | | try |
| | | { |
| | | HDate = DateTime.ParseExact(str[7], "yyyyMMdd", CultureInfo.InvariantCulture); |
| | | } |
| | | catch |
| | | { |
| | | sErrMsg = "条码解析失败," + str[7] + ",生产日期格式不正确!"; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | HProduceDate = HDate.ToString(); |
| | | |
| | | //if (!DateTime.TryParse(str[8], out HDate)) |
| | | //{ |
| | | // sErrMsg = "条码解析失败," + str[8] + ",保质期格式不正确!"; |
| | | // return false; |
| | | //} |
| | | //HExpiryDate = HDate.ToString(); |
| | | //HISKFPERIOD = 1; |
| | | } |
| | | |
| | | string HSupIDs = "0"; |
| | | //查询供应商 |
| | | ds = oCn.RunProcReturn("select * from Gy_Supplier with(nolock) where HNumber='" + str[2] + "' and HUSEORGID=" + HOrgIDs, "Gy_Supplier"); |
| | |
| | | |
| | | string HSourceInterIDs = "0"; |
| | | string HSourceEntryIDs = "0"; |
| | | string HUnitIDs = "0"; |
| | | |
| | | //查询采购订单 |
| | | ds = oCn.RunProcReturn(@"select a.HInterID,b.HEntryID,a.HBillNo,b.HUnitID from Cg_POOrderBillMain a with(nolock) inner join Cg_POOrderBillSub b with(nolock) on a.HInterID = b.HInterID where HBillNo='" + HSourceBillNos + "' and b.HMaterID=" + HMaterIDs, "Cg_POOrderBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | |
| | | { |
| | | HSourceInterIDs = ds.Tables[0].Rows[0]["HInterID"].ToString(); |
| | | HSourceEntryIDs = ds.Tables[0].Rows[0]["HEntryID"].ToString(); |
| | | HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString(); |
| | | //HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString(); |
| | | } |
| | | |
| | | |
| | |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" + |
| | | ",HProduceDate,HExpiryDate " + |
| | | ",HProduceDate,HExpiryDate,HISKFPERIOD " + |
| | | ") values (" |
| | | + "'" + sBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'admin',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'" |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterIDs.ToString() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','','')"); |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','"+ HProduceDate + "','"+ HExpiryDate + "',"+ HISKFPERIOD + ")"); |
| | | |
| | | return true; |
| | | } |