/// <summary> /// 搜索按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DMButton_Search_Click(object sender, RoutedEventArgs e) { shelfBase.ShelfList.Clear(); List <WMS_Shelf_Model> list = new List <WMS_Shelf_Model>(); DataTable dt = WMS_Shelf_Bll.Select_Shelf(" ShelfName = '" + SearchText.Text.Trim() + "'"); for (int i = 0; i < dt.Rows.Count; i++) { WMS_Shelf_Model wMS_Shelf_Model = new WMS_Shelf_Model { ShelfName = dt.Rows[i]["ShelfName"].ToString(), ShelfNo = dt.Rows[i]["ShelfNo"].ToString(), AreaNo = dt.Rows[i]["AreaNo"].ToString(), WarehouseNo = dt.Rows[i]["WarehouseNo"].ToString(), Remark = dt.Rows[i]["Remark"].ToString(), CreatPerson = dt.Rows[i]["CreatPerson"].ToString(), CreatTime = dt.Rows[i]["CreatTime"].ToString(), ModifyPerson = dt.Rows[i]["ModifyPerson"].ToString(), ModifyTime = dt.Rows[i]["ModifyTime"].ToString() }; list.Add(wMS_Shelf_Model); } foreach (var model in list) { shelfBase.ShelfList.Add(model); } this.ShelfDataGrid.ItemsSource = shelfBase.ShelfList; }
/// <summary> /// 获取列表 /// </summary> /// <returns></returns> public static List <WMS_Shelf_Model> GetShelfList() { List <WMS_Shelf_Model> list = new List <WMS_Shelf_Model>(); DataTable dt = WMS_Shelf_Bll.Select_Shelf(string.Empty); for (int i = 0; i < dt.Rows.Count; i++) { WMS_Shelf_Model wms_Shelf_Model = new WMS_Shelf_Model { ShelfName = dt.Rows[i]["ShelfName"].ToString(), ShelfNo = dt.Rows[i]["ShelfNo"].ToString(), AreaNo = dt.Rows[i]["AreaNo"].ToString(), WarehouseNo = dt.Rows[i]["WarehouseNo"].ToString(), Remark = dt.Rows[i]["Remark"].ToString(), CreatPerson = dt.Rows[i]["CreatPerson"].ToString(), CreatTime = dt.Rows[i]["CreatTime"].ToString(), ModifyPerson = dt.Rows[i]["ModifyPerson"].ToString(), ModifyTime = dt.Rows[i]["ModifyTime"].ToString() }; list.Add(wms_Shelf_Model); } return(list); }
/// <summary> /// 获取列表 /// </summary> /// <returns></returns> public static List <WMS_StoreDisplay_Model> GetStoreDisplayList() { List <WMS_StoreDisplay_Model> list = new List <WMS_StoreDisplay_Model>(); DataTable dataTable = WMS_Stock_Bll.Select_StockDisplay(); DataTable shelfDt = WMS_Shelf_Bll.Select_Shelf("ORDER"); for (int i = 0; i < shelfDt.Rows.Count; i++) //货架数 { DataTable dt = new DataTable(); dt = dataTable.AsEnumerable().Where(o => o.Field <string>("AreaNo").ToString() == shelfDt.Rows[i]["AreaNo"].ToString()).CopyToDataTable(); int f = 1; for (int m = 0; m < dt.Rows.Count; m++) //已存PACK { for (int j = 1; j <= int.Parse(dt.Rows[m]["ShelfNo"].ToString().Substring(2)); j++) //以空补足未存位置--竖 { if (int.Parse(dt.Rows[m]["LocationNo"].ToString().Substring(2)) == j) { for (int n = f; n < int.Parse(dt.Rows[m]["ShelfNo"].ToString().Substring(0, 2)); n++)//以空补足未存位置--横 { if (int.Parse(dt.Rows[m]["LocationNo"].ToString().Substring(0, 2)) == f) { SetColumn(f, dt.Rows[m]["SN"].ToString()); } f++; if (f == int.Parse(dt.Rows[m]["ShelfNo"].ToString().Substring(0, 2))) { f = 1; } } } list.Add(wMS_StoreDisplay_Model); wMS_StoreDisplay_Model = new WMS_StoreDisplay_Model(); } } } return(list); }