Beispiel #1
0
        private void ShowS33H(string reportId)
        {
            var _frm = new frmS33_H(reportId);

            _frm.ShowDialog();
            if (_frm.DialogResult == DialogResult.OK)
            {
                var _reportListModel = _reportList.FirstOrDefault(m => m.ReportId.Equals(reportId));
                if (_reportListModel == null)
                {
                    return;
                }

                object[] paramsStore = { nameof(GlobalVariable.StartedDate), DateTime.Parse(GlobalVariable.SystemDate),
                                         nameof(GlobalVariable.FromDate),    _frm.dateTimeRangeV1.FromDate,
                                         nameof(GlobalVariable.ToDate),      _frm.dateTimeRangeV1.ToDate,
                                         nameof(_frm.AccountingObjectId),    _frm.AccountingObjectId,
                                         nameof(_frm.AccountList),           _frm.AccountList,
                                         "SummaryAccountingObject",          false,
                                         "SummaryAccount",                   false,
                                         "IsSumSameEntry",                   false, };

                Dictionary <string, object> paramsReport = new Dictionary <string, object>()
                {
                    { nameof(GlobalVariable.FromDate), _frm.dateTimeRangeV1.FromDate.ToShortDateString() },
                    { nameof(GlobalVariable.ToDate), _frm.dateTimeRangeV1.ToDate.ToShortDateString() },
                };
                ReportTool.PreviewReport(this, _reportListModel, paramsStore, paramsReport);
            }
        }
        /// <summary>
        /// 打印执行卡
        /// </summary>
        /// <param name="iGroupIdList">勾选的需要打印的组Id</param>
        public void PrinterExeCard(List <PrintData> iGroupIdList)
        {
            //同组的在一个框内  但是每列都要有数据
            //_dtExcuteLis  报表数据源
            //_iReportType  执行单类型
            //3015.住院护士执行单服药单   OrderContents   BedCode  PatName    GroupID     Unit    Usage   Frequency
            //3016.住院护士执行单输液卡   OrderContents   BedCode  PatName    GroupID     Unit    Usage   Frequency   OrderContent   Amount   DropSpec    --ordertype
            //3017.住院护士执行单注射单   OrderContents   BedCode  PatName    GroupID     Unit    Usage   Frequency
            //3018.住院护士执行单治疗卡   OrderContents   BedCode  PatName    GroupID
            DataTable printTable = CreatePrintTable(iGroupIdList);

            if (printTable.Rows.Count > 0)
            {
                GridReport gridreport = new GridReport();
                gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, iReportType, 0, myDictionary, printTable);
                gridreport.PrintPreview(true);

                List <int> iExecIdList = new List <int>();
                foreach (PrintData printData in iGroupIdList)
                {
                    DataRow[] drs = dtExcuteLis.Select(" GroupId=" + printData.groupId + " and ExecDate='" + printData.execDate + "'");
                    foreach (DataRow dr in drs)
                    {
                        int iExecId = Convert.ToInt32(dr["ID"]);
                        iExecIdList.Add(iExecId);
                    }
                }

                if (iExecIdList.Count > 0)
                {
                    SetPrintState(iExecIdList, 1);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 血糖数据绑定
        /// </summary>
        /// <param name="dtBloodGluRecord">血糖数据</param>
        public void BindBloodGluRecord(DataTable dtBloodGluRecord)
        {
            try
            {
                GridViewResult.Stop();
                this.Cursor = Cursors.WaitCursor;
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                int       rowindex = dgvPatInfo.CurrentCell.RowIndex;
                DataTable dt       = (DataTable)dgvPatInfo.DataSource;
                myDictionary.Add("医院名称", (InvokeController("this") as AbstractController).LoginUserInfo.WorkName);
                myDictionary.Add("科室", dt.Rows[rowindex]["deptName"]);
                myDictionary.Add("姓名", dt.Rows[rowindex]["PatName"]);
                myDictionary.Add("性别", dt.Rows[rowindex]["PatSex"]);
                myDictionary.Add("年龄", GetAge(dt.Rows[rowindex]["Age"].ToString()));
                myDictionary.Add("床号", dt.Rows[rowindex]["BedNo"]);
                myDictionary.Add("住院号", dt.Rows[rowindex]["SerialNumber"]);

                gridreport            = new GridReport();
                gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3205, 0, myDictionary, dtBloodGluRecord);
                GridViewResult.Report = gridreport.Report;
                GridViewResult.Start();
                GridViewResult.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 绑定报表数据
        /// </summary>
        /// <param name="dt">数据源</param>
        public void BindGridData(DataTable dt)
        {
            PrintDt = dt;
            DateTime dtTemp = Convert.ToDateTime(dtYearMonth.Text + "-01");
            //本月第一天时间
            DateTime dtFirst = dtTemp.AddDays(-(dtTemp.Day) + 1);

            //将本月月数+1
            DateTime dt2 = dtTemp.AddMonths(1);

            //本月最后一天时间
            DateTime dtLast          = dt2.AddDays(-(dtTemp.Day));
            string   currentUserName = (string)InvokeController("GetCurrentUserName");
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("开始时间", dtFirst);
            myDictionary.Add("结束时间", dtLast);
            myDictionary.Add("科室", CmbDeptRoom.Text);
            myDictionary.Add("查询人", currentUserName);
            myDictionary.Add("查询时间", DateTime.Now);
            GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4028, 0, myDictionary, dt);

            axGRDisplayViewer.Report = gridreport.Report;
            axGRDisplayViewer.Start();
            axGRDisplayViewer.Refresh();
        }
Beispiel #5
0
        public void PrintReport(DataTable dt, bool isPrint)
        {
            // 做成报表数据
            DataTable reportDt = dt.Clone();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                int num = Tools.ToInt32(dt.Rows[i]["Num"]);
                for (int j = 0; j < num; j++)
                {
                    reportDt.Rows.Add(dt.Rows[i].ItemArray);
                }
            }

            if (reportDt.Rows.Count > 0)
            {
                if (isPrint)
                {
                    // 打印报表
                    ReportTool.GetReport(LoginUserInfo.WorkId, 3019, 0, null, reportDt).Print(true);
                    iprintExamConfirm.CloseForm();  // 关闭界面
                }
                else
                {
                    // 预览报表
                    ReportTool.GetReport(LoginUserInfo.WorkId, 3019, 0, null, reportDt).PrintPreview(true);
                }
            }
        }
Beispiel #6
0
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender">控件对象</param>
 /// <param name="e">事件参数</param>
 private void BtnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         GridViewResult.Stop();
         this.Cursor = Cursors.WaitCursor;
         DateTime  bdate           = Convert.ToDateTime(sdtDate.Bdate.Value.ToString("yyyy-MM-dd 00:00:00"));
         DateTime  edate           = Convert.ToDateTime(sdtDate.Edate.Value.ToString("yyyy-MM-dd 23:59:59"));
         int       queryWorkId     = Convert.ToInt32(cmbWorker.SelectedValue);
         int       queryTimeType   = cmbTimeType.SelectedIndex;//0收费时间 1缴款时间
         int       rowGroupType    = cmbRowGroupType.SelectedIndex;
         int       colGroupType    = cmbColGroupType.SelectedIndex;
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("GetFinacialOPRevenueData", frmName, bdate, edate, queryWorkId, queryTimeType, rowGroupType, colGroupType);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("Title", cmbWorker.Text.Trim() + "门诊收入统计");
         myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
         myDictionary.Add("Printer", currentUserName);
         gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 2006, 0, myDictionary, dtReport);
         gridreport.Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(ReportInitialize);
         GridViewResult.Report         = gridreport.Report;
         GridViewResult.Start();
         GridViewResult.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Beispiel #7
0
        private void print_btn_Click(object sender, EventArgs e)
        {
            ReportTool report = new ReportTool()
            {
                Title = "Schedule",
                Table = (System.Data.DataTable)schedule_dgv.DataSource
            };

            SaveFileDialog savefile = new SaveFileDialog();

            savefile.DefaultExt = "*.docx";
            savefile.Filter     = "DOCX files(*.docx)|*.docx|Excel files(.xlsx) |*.xlsx";


            if (savefile.ShowDialog() == DialogResult.OK && savefile.FileName.Length > 0)
            {
                if (savefile.FileName.EndsWith("docx") == true)
                {
                    report.toWordReport(savefile.FileName);
                    MessageBox.Show("File saved!", "Message Dialog", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                if (savefile.FileName.EndsWith("xlsx") == true)
                {
                    report.ToExcelReport(savefile.FileName);
                    MessageBox.Show("File saved!", "Message Dialog", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Beispiel #8
0
        private void print()
        {
            ReportTool report = new ReportTool()
            {
                Title = "Daily Report",
                Table = (DataTable)report_dgv.DataSource
            };

            SaveFileDialog savefile = new SaveFileDialog();

            savefile.DefaultExt = "*.docx";
            savefile.Filter     = "DOCX files(*.docx)|*.docx|Excel files(.xlsx) |*.xlsx";

            if (savefile.ShowDialog() == DialogResult.OK && savefile.FileName.Length > 0)
            {
                if (savefile.FileName.EndsWith("docx") == true)
                {
                    report.toWordReport(savefile.FileName);
                    MessageBox.Show("File saved!", "Message Dialog", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                if (savefile.FileName.EndsWith("xlsx") == true)
                {
                    report.ToExcelReport(savefile.FileName);
                    MessageBox.Show("File saved!", "Message Dialog", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender">控件</param>
 /// <param name="e">参数</param>
 private void btnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         axGRDisplayViewer.Stop();
         this.Cursor = Cursors.WaitCursor;
         int       queryYear       = Convert.ToInt32(cmbQueryYear.SelectedValue);
         int       queryMonth      = Convert.ToInt32(cmbQueryMonth.SelectedValue);
         int       deptId          = Convert.ToInt32(cmbDept.SelectedValue);
         int       typeId          = Convert.ToInt32(txtType.Tag);
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("InventoryStatistic", deptId, queryYear, queryMonth, typeId);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("会计年", cmbQueryYear.Text);
         myDictionary.Add("会计月", cmbQueryMonth.Text);
         myDictionary.Add("查询科室", cmbDept.Text);
         myDictionary.Add("类型", txtType.Text);
         myDictionary.Add("查询人", currentUserName);
         myDictionary.Add("HospitalName", (InvokeController("this") as AbstractController).LoginUserInfo.WorkName + "物资进销存报表");
         GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 5009, 0, myDictionary, dtReport);
         axGRDisplayViewer.Report = gridreport.Report;
         axGRDisplayViewer.Start();
         axGRDisplayViewer.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
        public void PrintDepositInfo(int depositID)
        {
            Action <ClientRequestData> derequestAction = ((ClientRequestData request) =>
            {
                request.AddData(depositID);
            });

            ServiceResponseData         deretdata = InvokeWcfService("IPProject.Service", "AdmissionController", "GetPayADeposit", derequestAction);
            DataTable                   dt        = deretdata.GetData <DataTable>(0);
            Dictionary <string, object> dic       = new Dictionary <string, object>();

            if (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() == "正常")
            {
                dt.Rows[0]["Head"] = LoginUserInfo.WorkName + "预交金缴款单";
                string serialNumber = dt.Rows[0]["SerialNumber"].ToString();
                string patName      = dt.Rows[0]["PatName"].ToString();
                dt.Rows[0]["SerialNumberName"] = patName + "(住院号" + serialNumber + ")";

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    for (int j = 0; j < dt.Rows[i].ItemArray.Length; j++)
                    {
                        dic.Add(dt.Columns[j].ColumnName, dt.Rows[i][j]);
                    }

                    dic.Add("Year", Convert.ToDateTime(dt.Rows[i]["MakerDate"]).Year);
                    dic.Add("Month", Convert.ToDateTime(dt.Rows[i]["MakerDate"]).Month);
                    dic.Add("Day", Convert.ToDateTime(dt.Rows[i]["MakerDate"]).Day);
                    dic.Add("TotalFees", dt.Rows[i]["TotalFee"].ToString());
                }

                ReportTool.GetReport(LoginUserInfo.WorkId, 3204, 0, dic, null).PrintPreview(true);
                InvokeWcfService("IPProject.Service", "AdmissionController", "UpdatePrintTime", derequestAction);
            }
        }
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender">控件对象</param>
 /// <param name="e">事件参数</param>
 private void BtnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         GridViewResult.Stop();
         this.Cursor = Cursors.WaitCursor;
         DateTime  bdate           = Convert.ToDateTime(sdtDate.Bdate.Value.ToString("yyyy-MM-dd 00:00:00"));
         DateTime  edate           = Convert.ToDateTime(sdtDate.Edate.Value.ToString("yyyy-MM-dd 23:59:59"));
         int       queryWorkId     = Convert.ToInt32(cmbWorker.SelectedValue);
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("GetFinacialDispenseData", frmName, bdate, edate, queryWorkId);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("Title", cmbWorker.Text.Trim() + "发药人员工作量统计");
         myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
         myDictionary.Add("Printer", currentUserName);
         GridReport gridreport = new GridReport();
         gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4019, 0, myDictionary, dtReport);
         GridViewResult.Report = gridreport.Report;
         GridViewResult.Start();
         GridViewResult.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Beispiel #12
0
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender">控件对象</param>
 /// <param name="e">事件参数</param>
 private void BtnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         GridViewResult.Stop();
         this.Cursor = Cursors.WaitCursor;
         DateTime  bdate           = dtTimer.Bdate.Value;
         DateTime  edate           = dtTimer.Edate.Value;
         int       queryWorkId     = Convert.ToInt32(cbbWork.SelectedValue);
         string    queryTimeType   = Convert.ToString(cbbTimeType.SelectedValue);
         string    qyeryDocType    = Convert.ToString(cbbDocType.SelectedValue);
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("QueryInpatientWorkLoad", queryWorkId, bdate.ToString("yyyy-MM-dd 00:00:00"), edate.ToString("yyyy-MM-dd 23:59:59"), qyeryDocType, queryTimeType);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("Title", cbbWork.Text.Trim() + "住院医生工作量统计");
         myDictionary.Add("DateRange", dtTimer.Bdate.Value.ToString("yyyy-MM-dd") + "至" + dtTimer.Edate.Value.ToString("yyyy-MM-dd"));
         myDictionary.Add("Printer", currentUserName);
         myDictionary.Add("DocType", "医生类型:" + cbbDocType.Text);
         myDictionary.Add("TimeType", "时间类型:" + cbbTimeType.Text);
         GridReport gridreport = new GridReport();
         gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3011, 0, myDictionary, dtReport);
         GridViewResult.Report = gridreport.Report;
         GridViewResult.Start();
         GridViewResult.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Beispiel #13
0
        private void ShowS61H(string reportId)
        {
            var _frm = new frmS33_H(reportId);

            _frm.ShowDialog();
            if (_frm.DialogResult == DialogResult.OK)
            {
                var _reportListModel = _reportList.FirstOrDefault(m => m.ReportId.Equals(reportId));
                if (_reportListModel == null)
                {
                    return;
                }

                object[] paramsStore = { "StartDate",                     DateTime.Parse(GlobalVariable.SystemDate),
                                         nameof(GlobalVariable.FromDate), _frm.dateTimeRangeV1.FromDate,
                                         nameof(GlobalVariable.ToDate),   _frm.dateTimeRangeV1.ToDate,
                                         "AccountNumberList",             _frm.AccountList,
                                         "@IsSameSummary",                false,
                                         "@AmountType",                   GlobalVariable.AmountTypeViewReport,
                                         "@CurrencyCode",                 GlobalVariable.CurrencyViewReport, };

                Dictionary <string, object> paramsReport = new Dictionary <string, object>()
                {
                    { nameof(GlobalVariable.FromDate), _frm.dateTimeRangeV1.FromDate.ToShortDateString() },
                    { nameof(GlobalVariable.ToDate), _frm.dateTimeRangeV1.ToDate.ToShortDateString() },
                };
                ReportTool.PreviewReport(this, _reportListModel, paramsStore, paramsReport);
            }
        }
Beispiel #14
0
        /// <summary>
        /// Views the report.
        /// </summary>
        public void ViewReport(bool isPrint, string reportId)
        {
            try
            {
                GlobalVariable.DateRangeSelectedIndex = dtReportPeriod.cboDateRange.SelectedIndex;
                GlobalVariable.FromDate             = dtReportPeriod.FromDate;
                GlobalVariable.ToDate               = dtReportPeriod.ToDate;
                GlobalVariable.AmountTypeViewReport = cboAmountType.SelectedIndex + 1;
                GlobalVariable.CurrencyViewReport   = cboCurrencyCode.EditValue.ToString();
                //ReportTool.CommonVariable = GlobalVariable;

                // Một số báo cáo dùng dataset sẽ in cách khác
                switch (reportId)
                {
                case CommonText.ReportS33_H:
                    ShowS33H(reportId);
                    break;

                case CommonText.ReportS61H:
                    ShowS61H(reportId);
                    break;

                default:
                    ReportTool.PrintPreview(this, _reportList, reportId, isPrint);
                    break;
                }

                dtReportPeriod.cboDateRange.SelectedIndex = GlobalVariable.DateRangeSelectedIndex;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex + "Lỗi:" + ex.InnerException);
            }
        }
        public ReportController(ILog log, ReportTool tool, ReportModel model, ReadOnlyDictionary <object, object> commonServices)
        {
            Log            = log;
            Tool           = tool;
            Model          = model;
            CommonServices = commonServices;

            //_uiFactory.Register<IImagingServerProperties, ImagingServerPropertiesForm>();
        }
Beispiel #16
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender">控件对象</param>
        /// <param name="e">事件参数</param>
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime bdate           = Convert.ToDateTime(sdtDate.Bdate.Value.ToString("yyyy-MM-dd 00:00:00"));
                DateTime edate           = Convert.ToDateTime(sdtDate.Edate.Value.ToString("yyyy-MM-dd 23:59:59"));
                int      queryWorkId     = Convert.ToInt32(cmbWorker.SelectedValue);
                string   currentUserName = (string)InvokeController("GetCurrentUserName");
                int      queryType       = 0;//0收入流水账 1预交金流水账
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                if (superTabControl1.SelectedTabIndex == 0)
                {
                    GVResultRevenue.Stop();
                    this.Cursor = Cursors.WaitCursor;
                    DataTable dtReport = (DataTable)InvokeController("GetFinacialIPAccountBookData", frmName, bdate, edate, queryWorkId, queryType);

                    myDictionary.Add("Title", cmbWorker.Text.Trim() + "住院收入流水账");
                    myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
                    myDictionary.Add("Printer", currentUserName);
                    decimal[] beginEnd = GetBeginAndEnd(0, dtReport);
                    myDictionary.Add("BeginFeeTotal", beginEnd[0]);
                    myDictionary.Add("EndFeeTotal", beginEnd[1]);
                    GridReport gridreport = new GridReport();
                    gridreport             = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3012, 0, myDictionary, dtReport);
                    GVResultRevenue.Report = gridreport.Report;
                    GVResultRevenue.Start();
                    GVResultRevenue.Refresh();
                }
                else
                {
                    queryType = 1;
                    GVResultDeposit.Stop();
                    this.Cursor = Cursors.WaitCursor;
                    DataTable dtReport = (DataTable)InvokeController("GetFinacialIPAccountBookData", frmName, bdate, edate, queryWorkId, queryType);

                    myDictionary.Add("Title", cmbWorker.Text.Trim() + "住院预交金流水账");
                    myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
                    myDictionary.Add("Printer", currentUserName);
                    decimal[] beginEnd = GetBeginAndEnd(1, dtReport);
                    myDictionary.Add("BeginFeeTotal", beginEnd[0]);
                    myDictionary.Add("EndFeeTotal", beginEnd[1]);
                    GridReport gridreport = new GridReport();
                    gridreport             = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3013, 0, myDictionary, dtReport);
                    GVResultDeposit.Report = gridreport.Report;
                    GVResultDeposit.Start();
                    GVResultDeposit.Refresh();
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #17
0
        /// <summary>
        /// 获取医技确费统计信息
        /// </summary>
        /// <param name="dt">医技确费统计数据</param>
        public void BindThatFeeCount(DataTable dt)
        {
            PrintData = dt;
            Dictionary <string, object> myDictionary = GetDictionary();
            GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, (int)OP_Enum.PrintReport.医技工作量统计, 0, myDictionary, dt);

            axGRDisplayViewer.Report = gridreport.Report;
            axGRDisplayViewer.Start();
            axGRDisplayViewer.Refresh();
        }
 public SampleApp()
 {
     InitializeComponent();
     _worker                     = new BackgroundWorker();
     _worker.DoWork             += _worker_DoWork;
     _worker.RunWorkerCompleted += _worker_RunWorkerCompleted;
     _report                     = new ReportTool(ServerAddress);
     txtStatus.Text              = "Sample App is running...";
     Text = $"Sample App - Target Server: {ServerAddress}";
 }
Beispiel #19
0
        /// <summary>
        /// 事件
        /// </summary>
        /// <param name="sender">对象</param>
        /// <param name="e">参数</param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string currentUserName = (string)InvokeController("GetCurrentUserName");
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("开始时间", dtpBillDate.Bdate.Value);
            myDictionary.Add("结束时间", dtpBillDate.Edate.Value);
            myDictionary.Add("科室", DeptRoom.Text);
            myDictionary.Add("查询人", currentUserName);
            myDictionary.Add("查询时间", DateTime.Now);
            ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4018, 0, myDictionary, PrintDt).PrintPreview(true);
        }
Beispiel #20
0
        public void ReportCellState(string type, Coordinate location)
        {
            BoardCell cell = Board[location.X, location.Y];

            if (cell.ShipNumber > 0)
            {
                ReportTool.WriteLine($" Type: {type} {location} {cell}");
            }
            else
            {
                ReportTool.WriteLine($" Type: {type} {location} ");         // shipNumber <=0 should be treated as exception
            }
        }
Beispiel #21
0
        public void ReportBoardState()
        {
            for (var x = 0; x < boardSize; x++)
            {
                for (var y = 0; y < boardSize; y++)
                {
                    BoardCell cell = Board[x, y];

                    ReportTool.Write($"{cell.State.ToString().Substring(0, 3)} ");
                }
                ReportTool.WriteLine("");
            }
        }
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="dtData">统计数据</param>
        public void LoadData(DataTable dtData)
        {
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("Title", cmbWorker.Text.Trim() + "药品医生开方统计");
            myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
            myDictionary.Add("Printer", (InvokeController("this") as AbstractController).LoginUserInfo.EmpName);

            gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 6001, 0, myDictionary, dtData);
            GridViewResult.Report = gridreport.Report;
            GridViewResult.Start();
            GridViewResult.Refresh();
        }
Beispiel #23
0
        public void Main_WhenArgumentEmpty_ThrowsArgumentNullException()
        {
            // Arrange
            var clientMock      = new Mock <IClient>();
            var generatorMock   = new Mock <IGenerator>();
            var systemUnderTest = new ReportTool(clientMock.Object, generatorMock.Object);

            // Act
            var actualException = Record.Exception(() => systemUnderTest.Main(string.Empty));

            // Assert
            actualException.Should().NotBeNull();
            actualException.Should().BeOfType <ArgumentNullException>();
        }
Beispiel #24
0
        public void Main_WhenInvalidReport_ShouldNotStartProcessing()
        {
            // Arrange
            var clientMock      = new Mock <IClient>();
            var generatorMock   = new Mock <IGenerator>();
            var systemUnderTest = new ReportTool(clientMock.Object, generatorMock.Object);

            // Act
            systemUnderTest.Main(InvalidReportsFile);

            // Assert
            clientMock.Verify(cli => cli.ScanAsync(It.IsAny <DataOptions>(), It.IsAny <IEnumerable <string> >(), It.IsAny <Uri>()), Times.Never);
            generatorMock.Verify(gen => gen.CreateReportsAsync(It.IsAny <IEnumerable <IReport> >(), It.IsAny <AzureDevOpsInstance>(), It.IsAny <string>()), Times.Never);
        }
Beispiel #25
0
        /// <summary>
        /// 事件
        /// </summary>
        /// <param name="sender">对象</param>
        /// <param name="e">参数</param>
        private void btnPrintCard_Click(object sender, EventArgs e)
        {
            DataTable excuteDt = InvokeController("GetExecuteBills") as DataTable;
            DataTable dt       = new DataTable();
            int       rowIndex = -1;

            dt       = dgFeeHead.DataSource as DataTable;
            rowIndex = dgFeeHead.CurrentCell.RowIndex;
            if (rowIndex >= 0)
            {
                DataRow   dr       = dt.Rows[rowIndex];
                DataTable presData = InvokeController("GetPrintPresData", Convert.ToInt32(dr["DocPresHeadID"]), Convert.ToInt32(dr["DocPresNO"])) as DataTable;
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                if (presData.Rows.Count > 0)
                {
                    DataRow exdr = excuteDt.Select("ChannelID=" + Tools.ToString(presData.Rows[0]["ChannelID"]) + string.Empty).FirstOrDefault();
                    if (exdr != null)
                    {
                        presData.Columns.Add("PatName");
                        presData.Columns.Add("VisitNO");
                        presData.Columns.Add("ExecDate");
                        InvokeController("GetPatInfo", Tools.ToInt32(dr["PatListID"]));
                        for (int i = 0; i < presData.Rows.Count; i++)
                        {
                            presData.Rows[i]["PatName"]  = txtName.Text;
                            presData.Rows[i]["VisitNO"]  = Tools.ToString(dtPatList.Rows[0]["VisitNO"]);
                            presData.Rows[i]["ExecDate"] = Convert.ToDateTime(presData.Rows[0]["PresDate"]).ToString("yyyy-MM-dd hh:mm:ss");
                        }

                        myDictionary.Add("WorkerName", (InvokeController("this") as AbstractController).LoginUserInfo.WorkName);
                        myDictionary.Add("DoseNum", Tools.ToString(presData.Rows[0]["DoseNum"]));
                        myDictionary.Add("Printer", (InvokeController("this") as AbstractController).LoginUserInfo.EmpName);
                        ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, (int)OP_Enum.PrintReport.输液卡, 0, myDictionary, presData).PrintPreview(true);
                    }
                    else
                    {
                        MessageBoxEx.Show("没有可打印的输液卡");
                    }
                }
                else
                {
                    MessageBoxEx.Show("没有可打印的数据");
                }
            }
            else
            {
                MessageBoxEx.Show("没有可打印的数据");
            }
        }
Beispiel #26
0
        public void Main_WhenFileNotFound_ThrowsArgumentException()
        {
            // Arrange
            var testFile        = "bogus";
            var clientMock      = new Mock <IClient>();
            var generatorMock   = new Mock <IGenerator>();
            var systemUnderTest = new ReportTool(clientMock.Object, generatorMock.Object);

            // Act
            var actualException = Record.Exception(() => systemUnderTest.Main(testFile));

            // Assert
            actualException.Should().NotBeNull();
            actualException.Should().BeOfType <ArgumentException>();
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender">控件对象</param>
        /// <param name="e">事件参数</param>
        private void BtQuery_Click(object sender, EventArgs e)
        {
            if (txtItem.Text == string.Empty)
            {
                MessageBoxEx.Show("请选择查询项目!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if ((Convert.ToInt16(cbbPatType.SelectedValue) == 1) && (Convert.ToString(cbbTimeType.SelectedValue) == "ChargeDate"))
            {
                MessageBoxEx.Show("门诊类型按记帐时间统计单项目收入!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            int      workID    = Convert.ToInt32(cmbWork.SelectedValue);
            DateTime queryDate = dtTimer.Value;
            int      patType   = Convert.ToInt32(cbbPatType.SelectedValue);
            string   timeType  = Convert.ToString(cbbTimeType.SelectedValue);
            string   itemInfo  = ItemID;

            try
            {
                GridViewResult.Stop();
                this.Cursor = Cursors.WaitCursor;
                string    currentUserName = (string)InvokeController("GetCurrentUserName");
                DataTable dtReport        = (DataTable)InvokeController("GetItmeItemStatistics", workID, queryDate, patType, timeType, itemInfo);
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                myDictionary.Add("TjTime", "统计时间:" + dtTimer.Value.ToString("yyyy-MM"));
                myDictionary.Add("Printer", "制表人:" + currentUserName);
                myDictionary.Add("PrintTime", "制表时间:" + DateTime.Now.ToString("yyyy-MM-dd"));
                myDictionary.Add("ItemName", txtItem.Text);
                GridReport gridreport = new GridReport();
                gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 2009, 0, myDictionary, dtReport);
                GridViewResult.Report = gridreport.Report;
                GridViewResult.Start();
                GridViewResult.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #28
0
        public Boolean AddAShipToBoard(Battleship ship)
        {
            if (IsBoardReadyToPlay || ship.ShipNumber <= 0)
            {
                return(false);
            }

            if (BattleShips.ContainsKey(ship.ShipNumber))
            {
                ReportTool.WriteLine("ShipNumber is already in board.");
                return(false);
            }

            if (ship.Deployment.Count > boardSize || ship.Deployment.Count <= 0)
            {
                ReportTool.WriteLine("Ship must fit entirely on the board");
                return(false);
            }

            if (!ship.IsValidDeployment())
            {
                ReportTool.WriteLine("The ship should be 1-by-n sized");
                return(false);
            }

            // check if ship position had been occupied by another ship
            foreach (Coordinate location in ship.Deployment)
            {
                if (Board[location.X, location.Y].State == CoordinateState.OCCUPIED)
                {
                    ReportTool.WriteLine("Ship can't overlap another ship. {location}");
                    return(false);
                }
            }

            // put ship on the board
            foreach (Coordinate location in ship.Deployment)
            {
                BoardCell cell = Board[location.X, location.Y];
                cell.State      = CoordinateState.OCCUPIED;
                cell.ShipNumber = ship.ShipNumber;
            }

            BattleShips.Add(ship.ShipNumber, ship);
            return(true);
        }
Beispiel #29
0
        private void btnEventReport_Click(object sender, EventArgs e)
        {
            foreach (Form c in this.ParentForm.MdiChildren)
            {
                if (c.GetType() == new ReportTool().GetType())
                {
                    rt = true;
                }
            }

            if (!rt)
            {
                ReportTool eventReport = new ReportTool();
                eventReport.MdiParent = this.ParentForm;
                eventReport.Show();
            }
        }
Beispiel #30
0
        /// <summary>
        /// 绑定药品网格信息
        /// </summary>
        /// <param name="dt">报表数据</param>
        public void BindDgData(DataTable dt)
        {
            PrintDt = dt;
            string currentUserName = (string)InvokeController("GetCurrentUserName");
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("开始时间", dtpBillDate.Bdate.Value);
            myDictionary.Add("结束时间", dtpBillDate.Edate.Value);
            myDictionary.Add("科室", DeptRoom.Text);
            myDictionary.Add("查询人", currentUserName);
            myDictionary.Add("查询时间", DateTime.Now);
            GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4018, 0, myDictionary, dt);

            axGRDisplayViewer.Report = gridreport.Report;
            axGRDisplayViewer.Start();
            axGRDisplayViewer.Refresh();
        }
Beispiel #31
0
        private void LoadReport(ReportInfo info)
        {
            // show the report tool
            HideSearch();
            reportViewer = (ReportTool)ChangeTool(ToolType.Report, true);
            ChangeToolHeaderText("Report Details");
            ChangeToolHeaderIcon(SecureDeleteWinForms.Properties.Resources.file);

            reportViewer.StopPopulating();
            WipeReport report = reportManager.LoadReport(info);

            if(report != null) {
                reportViewer.Report = report;
            }
        }