public async Task <ActionResult> UpdateLabel(OutModels.Models.ProductLabel label) { try { ProductLabelModel lbl = (ProductLabelModel)_mapper.Map <OutModels.Models.ProductLabel, ProductLabelModel>(label); return(new JsonResult(await this._repository.Update(lbl))); } catch (Exception ex) { return(null); } }
public static string SearchData(string tabid, string partno) { string res = string.Empty; try { string sql = ""; //属性 if (tabid == "attribute") { sql = "SELECT [PartNO],[BoxHeight],[GasketThick],[CornerType],[BaseNO],[Creator],[CreateDate] " + " FROM[FGA_PLATFORM].[dbo].[ARG_part_box_attribute]"; } //附件 if (tabid == "attribute") { sql = "SELECT [PartNO],[Component_Part],[Component_Type],[Creator],[CreateDate] FROM [FGA_PLATFORM].[dbo].[ARG_part_accessory] where 1=1 "; } //包边模式 if (tabid == "attribute") { sql = "SELECT [PartNO],[EdgeType],[Creator],[CreateDate] FROM [FGA_PLATFORM].[dbo].[ARG_part_edgetype] where 1=1 "; } //查询条件 if (!String.IsNullOrEmpty(partno)) { sql = sql + " and [PartNO] like '" + partno + "'"; } DataSet ds = new DataSet(); ds = FGA_DAL.Base.SQLServerHelper_FGA.Query(sql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { List <ProductLabelModel> luw = new List <ProductLabelModel>(); foreach (DataRow row in ds.Tables[0].Rows) { ProductLabelModel ERM = new ProductLabelModel(row); luw.Add(ERM); } JavaScriptSerializer jssl = new JavaScriptSerializer(); res = jssl.Serialize(luw); res = res.Replace("\\/Date(", "").Replace(")\\/", ""); } } catch (Exception e) { } return(res); }
public static string SearchData(string pncode, string isHide) { string res = string.Empty; try { string sql = "SELECT Bp.* FROM (SELECT SD.[ItemID],SD.[ShipmentNO],SD.[InvoiceNO],SD.[ItemCode],SD.[LabelNO] " + " , UPPER(SD.[BoxType]) AS [BoxType],SD.[BoxNO],UPPER(SD.[BoxMethod]) AS [BoxMethod],SD.[InboundQuantity],SD.[ShipmentDate],ISNULL(ABT.BarcodeNO,'') AS BarcodeNO, " + " ISNULL(APT.Location,'') as Location,ABT.[FinishQty] AS Quantity,ABT.[Creator],ABT.[CreateDate],ISNULL(ABT.[BoxStatus],'') AS BoxStatus,ABT.[Updator],ABT.[UpdateDate] " + " FROM [ShipmentDetail] SD left join [ARGBoxLabel_T] ABT on SD.ItemID = ABT.ItemID and len(ABT.Barcodeno) > 7 left join ARGPartialBox_T APT on ABT.BarcodeNO = APT.BarcodeNO and isnull(APT.dr,0) =0 " + " WHERE ((SD.OrderStatus<> 'OrderCancel' and upper(SD.BoxType) <> 'BOX' and isnull(SD.BoxMethod,'N') = 'N' and ISNULL(SD.ChangedNumber,'') ='' and not exists " + " (select 1 from ARGBoxLabel_T att where att.itemid = sd.itemid)) or (exists (select 1 from ARGBoxLabel_T att left join ARGPartialBox_T apt on att.barcodeno = apt.barcodeno " + " and isnull(apt.dr,'1') = '0' where att.itemid = sd.itemid and att.location <> 'T4' and len(att.barcodeno) > 7 ) ))"; if (!String.IsNullOrEmpty(pncode)) { sql = sql + " and SD.[ItemCode] like '%" + pncode + "%') Bp where 1=1"; } if (isHide == "1") { sql = sql + " and isnull(Bp.BoxStatus,'') <>'Finish' "; } sql = sql + " order by Bp.[ShipmentDate] asc,Bp.[BoxStatus] desc,Bp.[BoxType]"; DataSet ds = new DataSet(); ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { List <ProductLabelModel> luw = new List <ProductLabelModel>(); foreach (DataRow row in ds.Tables[0].Rows) { ProductLabelModel ERM = new ProductLabelModel(row); luw.Add(ERM); } JavaScriptSerializer jssl = new JavaScriptSerializer(); res = jssl.Serialize(luw); res = res.Replace("\\/Date(", "").Replace(")\\/", ""); } } catch (Exception e) { } return(res); }
public static string SearchData(string itemcode) { string res = string.Empty; try { string sql = "SELECT DISTINCT [ItemID],[InvoiceNO],[PlanNO],[ItemCode] " + " ,[LabelNO],[BoxType],[SOQuantity],[InboundQuantity] " + " ,[CreateUser],[CreateDate] FROM [WMS_BarCode_V10].[dbo].[ShipmentDetail] where 1=1"; //查询条件 if (!String.IsNullOrEmpty(itemcode)) { sql = sql + " and [ItemCode] like '" + itemcode + "'"; } sql = sql + " order by createdate"; DataSet ds = new DataSet(); ds = FGA_DAL.Base.SQLServerHelper_WMS.Query(sql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { List <ProductLabelModel> luw = new List <ProductLabelModel>(); foreach (DataRow row in ds.Tables[0].Rows) { ProductLabelModel ERM = new ProductLabelModel(row); luw.Add(ERM); } JavaScriptSerializer jssl = new JavaScriptSerializer(); res = jssl.Serialize(luw); res = res.Replace("\\/Date(", "").Replace(")\\/", ""); } } catch (Exception e) { } return(res); }