private void BtnCancle_Click(object sender, RoutedEventArgs e) { if (DGTrayItemsDetail.Items.Count > 0 && DGTrayItemsDetail.SelectedItems.Count > 0) { List <string> cancleIds = DGTrayItemsDetail.SelectedCells.Where(i => ((Trays)i.Item).status != (int)TrayStatus.Cancled).Select(i => ((Trays)i.Item).trayId).Distinct().ToList <string>(); if (cancleIds.Count > 0) { ProcessMsg msg = packageStoreService.CancleStored(cancleIds); if (msg.result) { string errorMsg = msg.GetMessage(ReturnCode.Warning).Trim(); if (errorMsg.Length > 0) { new InfoBoard(MsgLevel.Warning, errorMsg).ShowDialog(); } new InfoBoard(MsgLevel.Successful, "取消成功!", 10000).ShowDialog(); BtnSearch_Click(sender, e); } else { new InfoBoard(MsgLevel.Warning, msg.GetAllLevelMsgs()).ShowDialog(); } } else { new InfoBoard(MsgLevel.Warning, "请选择未取消托盘").ShowDialog(); } } }
private void BtnSync_Click(object sender, RoutedEventArgs e) { if (DGTrayItemsDetail.Items.Count > 0) { ProcessMsg msg = packageStoreService.SyncStore(); new InfoBoard(MsgLevel.Info, msg.GetAllLevelMsgs()).ShowDialog(); } }
private void BtnNew_Click(object sender, RoutedEventArgs e) { ConfigUtil config = new ConfigUtil("STORE", "config.ini"); ProcessMsg msg = conditionService.GenPosition(config.Get("POSITION")); if (msg.result) { SPDataSource = null; DGTrayItemsDetail.ItemsSource = null; BtnFinsh.IsEnabled = false; BtnRePrint.IsEnabled = false; TBPackageId.IsEnabled = true; LabPackNum.Content = "0"; TBTrayId.Text = ""; TBPackageId.Text = ""; // LoadWarehouseConfig(); TBWarehouse.Text = config.Get("WAREHOUSE"); TBPosition.Text = msg.GetAllLevelMsgs().Trim(); } else { new InfoBoard(MsgLevel.Mistake, msg.GetAllLevelMsgs()).ShowDialog(); } }
private void BtnFinsh_Click(object sender, RoutedEventArgs e) { if (TBWarehouse.Text.Length > 0 && TBPosition.Text.Length > 0) { if (int.Parse(LabPackNum.Content.ToString()) > 0) { if (SPDataSource != null) { ProcessMsg msg = packageStoreService.CompleteStore(SPDataSource.Select(t => t.packageID).ToList <string>(), TBWarehouse.Text, TBPosition.Text.ToString()); if (msg.result) { string errorMsg = msg.GetMessage(ReturnCode.Warning).Trim(); if (errorMsg.Length > 0) { new InfoBoard(MsgLevel.Warning, errorMsg).ShowDialog(); } TBTrayId.Text = msg.GetMessage(ReturnCode.OK).Trim(); TBPackageId.IsEnabled = false; BtnFinsh.IsEnabled = false; BtnRePrint.IsEnabled = true; BtnNew.IsEnabled = true; bool?print = new InfoBoard(MsgLevel.Successful, "入库成功,是否打印包装箱标签?\n标签号为:" + TBTrayId.Text).ShowDialog(); if ((bool)print) { this.PrintTrayLabel(TBTrayId.Text); } } else { new InfoBoard(MsgLevel.Warning, msg.GetAllLevelMsgs()).ShowDialog(); } } } else { new InfoBoard(MsgLevel.Warning, "未开始入库!").ShowDialog(); } } else { new InfoBoard(MsgLevel.Warning, "未输入仓库或库位!").ShowDialog(); } }
public static Message PrintTrayLabel(string trayId) { Message msg = new Message(); PrintService printService = new PrintService(); PrintDataMessage pmsg = printService.GenSingleTrayLabel(trayId , new ConfigUtil("DATEFORMAT", "config.ini").Get("DATEFORMAT") , new ConfigUtil("KEEPER", "config.ini").Get("KEEPER").Split(',')); if (pmsg.ReturnedResult) { Hashtable printConfig = PrinterUtil.GetPrinterConfig();; ProcessMsg prmsg = printService.Print(printConfig, pmsg); msg.Result = prmsg.result; msg.Content = prmsg.GetAllLevelMsgs(); } else { msg.Result = pmsg.ReturnedResult; msg.Content = pmsg.GetMsgText(); } return(msg); }
private void BtnExport_Click(object sender, RoutedEventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "CSV 文件格式|*.csv"; sfd.Title = "导出CSV文件"; sfd.FileName = "CSVData" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".csv"; sfd.ShowDialog(); if (sfd.FileName != "") { if (DGTrayItemsDetail.Items.Count > 0) { List <string> exportIds = new List <string>(); foreach (Trays t in DGTrayItemsDetail.Items) { exportIds.Add(t.trayId); } ConfigUtil config = new ConfigUtil("CSVFILEDS", "csv.ini"); List <string> csvFields = new List <string> (); string[] keys = config.GetAllNodeKey(); foreach (string key in keys) { if (config.Get(key) == "1") { csvFields.Add(key); } } ProcessMsg msg = exportService.ExportTraySumPartCSV(exportIds, sfd.FileName, csvFields); new InfoBoard(MsgLevel.Info, msg.GetAllLevelMsgs()).ShowDialog(); config = new ConfigUtil("AUTO", "config.ini"); if (msg.result && bool.Parse(config.Get("EXPORTLOAD"))) { BtnSearch_Click(sender, e); } } } }