private void btnPrint_Click(object sender, EventArgs e) { try { string startPath = Application.StartupPath + "\\report\\药品供应商统计单据.grf"; YP_PrintCondition condition = new YP_PrintCondition(); condition.actYear = cobBeginDate.Value.ToString(); condition.actMonth = cobEndDate.Value.ToString(); condition.userId = Convert.ToInt32(user.EmployeeID); PrintFactory.GetPrinter("Support_Report").PrintReport(condition, (DataTable)dgvDetail.DataSource, startPath); } catch (Exception error) { MessageBox.Show(error.Message); } }
//摆药按钮 private void btnPutDrug_Click(object sender, EventArgs e) { try { this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (_recipeOrder != null) { YP_PrintCondition printCondition = new YP_PrintCondition(); printCondition.userId = (int)_currentUserId; printCondition.drugType = chkIsOnlyPutPO.Checked ? "口服药" : "全部药品"; printCondition.queyType = cobSumWay.SelectedIndex; DataRow[] dRows; switch (cobSumWay.SelectedIndex) { case 0: dRows = _recipeOrder.Select("DOCORDERTYPE=0"); break; case 1: dRows = _recipeOrder.Select("DOCORDERTYPE=1"); break; default: dRows = _recipeOrder.Select(""); break; } if (dRows.Count() > 0) { string startPath = Application.StartupPath + "\\report\\住院摆药单.grf"; PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "ZY_BY").PrintReport(printCondition, dRows.CopyToDataTable(), startPath); } } } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }
private void btnPrint_Click(object sender, EventArgs e) { try { if (dgrdDrugIOS.DataSource != null) { DataTable printDt = (DataTable)(dgrdDrugIOS.DataSource); string startPath = Application.StartupPath + "\\report\\药品进销存报表.grf"; YP_PrintCondition condition = new YP_PrintCondition(); condition.actYear = cobQueryYear.Text; condition.actMonth = cobQueryMonth.Text; condition.drugType = cobQueryType.Text; condition.userId = (int)_currentUser; condition.deptId = (int)_currentDept; PrintFactory.GetPrinter("IOS_Report").PrintReport(condition, printDt, startPath); } } catch (Exception error) { MessageBox.Show(error.Message); } }