private void ProcedurePrint_Click(object sender, RoutedEventArgs e) { if (lcv.CurrentItem == null) { return; } SalaryProcedureInfoWrap salaryProcedureInfoWrap = new SalaryProcedureInfoWrap(); SalaryInfo info = Do_GetSalaryProcedureInfo(lcv.CurrentItem as SalaryInfo, ref salaryProcedureInfoWrap); if (info != null) { string msg = ""; if (PrintDeal.CreateInstance().PrintSalarySheet(info, salaryProcedureInfoWrap, ref msg)) { MessageBox.Show("打印完成。"); } else { if (!string.IsNullOrEmpty(msg)) { MessageBox.Show(msg); } } } }
private void PrintRightBtn_Click(object sender, RoutedEventArgs e) { CollectionViewSource cvs = FindResource("ViewSource") as CollectionViewSource; if (cvs == null) { return; } if (cvs.View.CurrentItem == null) { return; } SheetInfo sheetInfo = cvs.View.CurrentItem as SheetInfo; string msg = ""; if (PrintDeal.CreateInstance().PrintSheetRightSheet(sheetInfo, CurProcedureInfoList.ToList(), CurBOPInfoList.ToList(), ref msg)) { MessageBox.Show("打印完成。"); } else { if (!string.IsNullOrEmpty(msg)) { MessageBox.Show(msg); } } }
private void PrintBtn_Click(object sender, RoutedEventArgs e) { string searchKeys = ""; if (!string.IsNullOrEmpty(FitterGeneralText.Text.Trim())) { searchKeys += "[关键字:" + FitterGeneralText.Text.Trim() + "]"; } if (StartDatePicker.SelectedDate != null && EndDatePicker.SelectedDate != null) { searchKeys += (string.IsNullOrEmpty(searchKeys) ? "[" : ",[") + "日期:" + StartDatePicker.Text + " 至 " + EndDatePicker.Text + "]"; } CollectionViewSource cvs = FindResource("ViewSource") as CollectionViewSource; if (cvs == null) { return; } List <BOPInfo> bopList = new List <BOPInfo>(); foreach (BOPInfo bopInfo in cvs.View) { bopList.Add(bopInfo); } if (bopList.Count == 0) { MessageBox.Show("当前列表为空,无法打印。"); return; } string msg = ""; bool isPrintSuccess = false; switch ((BOPType)(((DictionaryEntry)(BOPTypeList.SelectedValue)).Key)) { case BOPType.P: isPrintSuccess = PrintDeal.CreateInstance().PrintPayment(searchKeys, bopList, ref msg); break; case BOPType.B: isPrintSuccess = PrintDeal.CreateInstance().PrintBalance(searchKeys, bopList, ref msg); break; } if (isPrintSuccess) { MessageBox.Show("打印完成。"); } else { if (!string.IsNullOrEmpty(msg)) { MessageBox.Show(msg); } } }
private void PrintLeftBtn_Click(object sender, RoutedEventArgs e) { CollectionViewSource cvs = FindResource("ViewSource") as CollectionViewSource; if (cvs == null) { return; } List <SheetInfo> sheetList = new List <SheetInfo>(); foreach (SheetInfo sheetInfo in cvs.View) { sheetList.Add(sheetInfo); } if (sheetList.Count == 0) { MessageBox.Show("当前列表为空,无法打印。"); return; } string msg = ""; if (PrintDeal.CreateInstance().PrintSheetLeftSheet(GetSearchKeys(), sheetList, ref msg)) { MessageBox.Show("打印完成。"); } else { if (!string.IsNullOrEmpty(msg)) { MessageBox.Show(msg); } } }