Пример #1
0
        private void Kydong_InPhieuKhambenh(DataTable m_dtReport, string sTitleReport)
        {
            Utility.UpdateLogotoDatatable(ref m_dtReport);
            Utility.WaitNow(this);
            crpt_PhieuKCB crpt    = new crpt_PhieuKCB();
            var           objForm = new frmPrintPreview("", crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);

            try
            {
                //foreach (DataRow row in m_dtReport.Rows)
                //{
                //    row["Department_Name"] = row["Department_Name"].ToString().Replace("Khám", "").ToString();
                //    row["Department_Name"] = "Khám " + row["Department_Name"].ToString();
                //}
                m_dtReport.AcceptChanges();
                crpt.SetDataSource(m_dtReport);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "                                                                           PHÒNG TIẾP ĐÓN   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("Telephone", globalVariables.Branch_Phone);
                crpt.SetParameterValue("Address", globalVariables.Branch_Address);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                //  frmPrintPreview objForm = new frmPrintPreview("", crpt, true, strPatientCode == null ? false : true);
                //  crpt.SetParameterValue("TongTien", Total.ToString());
                //crpt.SetParameterValue("characterMoney", MoneyByLetter.sMoneyToLetter(Total.ToString()));
                //crpt.SetParameterValue("TongTien","10000");
                //crpt.SetParameterValue("Staff_Name", BusinessHelper.GetNameByUserName(globalVariables.UserName));
                crpt.SetParameterValue("CurrentDate", Utility.FormatDateTime(BusinessHelper.GetSysDateTime()));
                crpt.SetParameterValue("sTitleReport", sTitleReport);

                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
Пример #2
0
        private void Kydong_InPhieuKhambenh(DataTable m_dtReport, string sTitleReport)
        {
            Utility.UpdateLogotoDatatable(ref m_dtReport);
            Utility.WaitNow(this);
            crpt_PhieuKCB crpt = new crpt_PhieuKCB();
            var objForm = new frmPrintPreview("", crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
            try
            {
                //foreach (DataRow row in m_dtReport.Rows)
                //{
                //    row["Department_Name"] = row["Department_Name"].ToString().Replace("Khám", "").ToString();
                //    row["Department_Name"] = "Khám " + row["Department_Name"].ToString();
                //}
                m_dtReport.AcceptChanges();
                crpt.SetDataSource(m_dtReport);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "                                                                           PHÒNG TIẾP ĐÓN   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("Telephone", globalVariables.Branch_Phone);
                crpt.SetParameterValue("Address", globalVariables.Branch_Address);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                //  frmPrintPreview objForm = new frmPrintPreview("", crpt, true, strPatientCode == null ? false : true);
                //  crpt.SetParameterValue("TongTien", Total.ToString());
                //crpt.SetParameterValue("characterMoney", MoneyByLetter.sMoneyToLetter(Total.ToString()));
                //crpt.SetParameterValue("TongTien","10000");
                //crpt.SetParameterValue("Staff_Name", BusinessHelper.GetNameByUserName(globalVariables.UserName));
                crpt.SetParameterValue("CurrentDate", Utility.FormatDateTime(BusinessHelper.GetSysDateTime()));
                crpt.SetParameterValue("sTitleReport", sTitleReport);

                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }