/// <summary> /// 搜索按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DMButton_Search_Click(object sender, RoutedEventArgs e) { productionBase.ProductionList.Clear(); List <WMS_Production_Model> list = new List <WMS_Production_Model>(); DataTable dt = WMS_Production_Bll.Select_Production(" ProductionName = '" + SearchText.Text.Trim() + "'"); for (int i = 0; i < dt.Rows.Count; i++) { WMS_Production_Model wMS_Production_Model = new WMS_Production_Model { ProductionNo = dt.Rows[i]["ProductionNo"].ToString(), ProductionName = dt.Rows[i]["ProductionName"].ToString(), LocationNo = dt.Rows[i]["LocationNo"].ToString(), WarehouseNo = dt.Rows[i]["WarehouseNo"].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_Production_Model); } foreach (var model in list) { productionBase.ProductionList.Add(model); } this.ProductionDataGrid.ItemsSource = productionBase.ProductionList; }
/// <summary> /// 获取列表 /// </summary> /// <returns></returns> public static List <WMS_Production_Model> GetProductionList() { List <WMS_Production_Model> list = new List <WMS_Production_Model>(); DataTable dt = WMS_Production_Bll.Select_Production(string.Empty); for (int i = 0; i < dt.Rows.Count; i++) { WMS_Production_Model wms_Production_Model = new WMS_Production_Model { ProductionNo = dt.Rows[i]["ProductionNo"].ToString(), ProductionName = dt.Rows[i]["ProductionName"].ToString(), LocationNo = dt.Rows[i]["LocationNo"].ToString(), WarehouseNo = dt.Rows[i]["WarehouseNo"].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_Production_Model); } return(list); }