public bool BinIsDefault(string location, string bincode, string itemno, string pid) { ItemBinContent_Service bincontentservice = new ItemBinContent_Service(); bincontentservice.UseDefaultCredentials = true; List <ItemBinContent_Filter> BincontentFilterArray = new List <ItemBinContent_Filter>(); ItemBinContent_Filter LocationFilter = new ItemBinContent_Filter(); LocationFilter.Field = ItemBinContent_Fields.Location_Code; LocationFilter.Criteria = location; BincontentFilterArray.Add(LocationFilter); ItemBinContent_Filter BinFilter = new ItemBinContent_Filter(); BinFilter.Field = ItemBinContent_Fields.Bin_Code; BinFilter.Criteria = bincode; BincontentFilterArray.Add(BinFilter); ItemBinContent_Filter ItemFilter = new ItemBinContent_Filter(); ItemFilter.Field = ItemBinContent_Fields.Item_No; ItemFilter.Criteria = itemno; BincontentFilterArray.Add(ItemFilter); ItemBinContent[] Details = bincontentservice.ReadMultiple(BincontentFilterArray.ToArray(), "", 100); if (Details.Count() > 0) { return(Details.Last().Default); } return(false); }
public string GetDefaultBin(string location, string itemno) { ItemBinContent_Service bincontentservice = new ItemBinContent_Service(); bincontentservice.UseDefaultCredentials = true; List <ItemBinContent_Filter> BincontentFilterArray = new List <ItemBinContent_Filter>(); ItemBinContent_Filter LocationFilter = new ItemBinContent_Filter(); LocationFilter.Field = ItemBinContent_Fields.Location_Code; LocationFilter.Criteria = location; BincontentFilterArray.Add(LocationFilter); ItemBinContent_Filter ItemFilter = new ItemBinContent_Filter(); ItemFilter.Field = ItemBinContent_Fields.Item_No; ItemFilter.Criteria = itemno; BincontentFilterArray.Add(ItemFilter); ItemBinContent_Filter DefaultFilter = new ItemBinContent_Filter(); DefaultFilter.Field = ItemBinContent_Fields.Default; DefaultFilter.Criteria = true.ToString(); BincontentFilterArray.Add(DefaultFilter); ItemBinContent[] Details = bincontentservice.ReadMultiple(BincontentFilterArray.ToArray(), "", 10); if (Details.Count() > 0) { return(Details.First().Bin_Code); } return(""); }
public void GetBinContent() { ItemBinContent_Service itembincontentservice = new ItemBinContent_Service(); itembincontentservice.UseDefaultCredentials = true; List <ItemBinContent_Filter> ItemBincontentFilterArray = new List <ItemBinContent_Filter>(); ItemBinContent_Filter LocationFilter = new ItemBinContent_Filter(); LocationFilter.Field = ItemBinContent_Fields.Location_Code; LocationFilter.Criteria = Globals.theLocation; ItemBincontentFilterArray.Add(LocationFilter); ItemBinContent_Filter ItemNoFilter = new ItemBinContent_Filter(); ItemNoFilter.Field = ItemBinContent_Fields.Item_No; ItemNoFilter.Criteria = itemno; ItemBincontentFilterArray.Add(ItemNoFilter); ItemBinContent_Filter QtyFilter = new ItemBinContent_Filter(); QtyFilter.Field = ItemBinContent_Fields.Quantity_Base; QtyFilter.Criteria = "<>0"; ItemBincontentFilterArray.Add(QtyFilter); ItemBinContent[] Result = itembincontentservice.ReadMultiple(ItemBincontentFilterArray.ToArray(), "", 100); if (Result.Count() > 0) { dataGridView1.DataSource = Result; dataGridView1.Update(); } }
public bool GetItemBincontent(string location, string bincode, string itemno, ref decimal quantity, ref string uom) { ItemBinContent_Service bincontentservice = new ItemBinContent_Service(); bincontentservice.UseDefaultCredentials = true; List <ItemBinContent_Filter> BincontentFilterArray = new List <ItemBinContent_Filter>(); ItemBinContent_Filter LocationFilter = new ItemBinContent_Filter(); LocationFilter.Field = ItemBinContent_Fields.Location_Code; LocationFilter.Criteria = location; BincontentFilterArray.Add(LocationFilter); if (bincode != "") { ItemBinContent_Filter BinFilter = new ItemBinContent_Filter(); BinFilter.Field = ItemBinContent_Fields.Bin_Code; BinFilter.Criteria = bincode; BincontentFilterArray.Add(BinFilter); } if (itemno != "") { ItemBinContent_Filter ItemFilter = new ItemBinContent_Filter(); ItemFilter.Field = ItemBinContent_Fields.Item_No; ItemFilter.Criteria = itemno; BincontentFilterArray.Add(ItemFilter); } ItemBinContent [] Details = bincontentservice.ReadMultiple(BincontentFilterArray.ToArray(), "", 1000); if (Details.Count() > 0) { quantity = Details.First().CalcQtyUOM; uom = Details.First().Unit_of_Measure_Code; return(true); } return(false); }