Example #1
0
        private void InPhieuKham(string tenkhoa, Button button, string sokham, string tensoQMS)
        {
            try
            {
                string val = tensoQMS;
                Utility.WaitNow(this);
                UIAction._EnableControl(button, false, "");
                DataTable dataTable = new DataTable();
                Utility.AddColumToDataTable(ref dataTable, "So_Kham", typeof(string));
                DataRow row = dataTable.NewRow();

                row["So_Kham"] = Utility.sDbnull(sokham);
                dataTable.Rows.Add(row);

                CRPT_SOKHAM crpt_sokham = new CRPT_SOKHAM();

                crpt_sokham.SetDataSource(dataTable);
                crpt_sokham.SetParameterValue("TEN_BENH_VIEN", _QMSProperties.TenBenhVien);
                string str2 = NgayIn(DateTime.Now);
                crpt_sokham.SetParameterValue("PrintDate", str2);
                if (loaisoqms == "SOKHAM")
                {
                    crpt_sokham.SetParameterValue("TenKhoa", Utility.sDbnull(tenkhoa));
                }
                else
                {
                    crpt_sokham.SetParameterValue("TenKhoa", Utility.sDbnull(_QMSProperties.TenKhoaKhamBenhKhac));
                }

                crpt_sokham.SetParameterValue("LoaiDoiTuong", val);
                if (loaisoqms == "SOKHAM")
                {
                    crpt_sokham.SetParameterValue("NoiChokham", _QMSProperties.QuaySokham);
                }
                else
                {
                    crpt_sokham.SetParameterValue("NoiChokham", _QMSProperties.QuaySokhac);
                }
                if (!string.IsNullOrEmpty(_QMSProperties.PrinterName))
                {
                    crpt_sokham.PrintOptions.PrinterName = Utility.sDbnull(_QMSProperties.PrinterName);
                }
                crpt_sokham.PrintToPrinter(1, false, 0, 0);
                UIAction._EnableControl(button, true, "");
                button.Focus();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi in số khám\n" + ex.Message);
            }
            finally
            {
                UIAction._EnableControl(button, true, "");
                Utility.DefaultNow(this);
            }
        }
Example #2
0
        private void InPhieuKham(string tenkhoa, Button button, string sokham, int isUuTien)
        {
            try
            {
                string val = "BỆNH NHÂN THƯỜNG";
                if (ma_KhoaKcb == "KKB")
                {
                    val = (isUuTien == 0) ? "BỆNH NHÂN THƯỜNG" : "BỆNH NHÂN ƯU TIÊN";
                }

                UIAction._EnableControl(button, false, "");
                DataTable dataTable = new DataTable();
                Utility.AddColumToDataTable(ref dataTable, "So_Kham", typeof(string));
                DataRow row = dataTable.NewRow();
                row["So_Kham"] = Utility.sDbnull(sokham);
                dataTable.Rows.Add(row);
                CRPT_SOKHAM crpt_sokham = new CRPT_SOKHAM();
                crpt_sokham.SetDataSource(dataTable);
                crpt_sokham.SetParameterValue("TEN_BENH_VIEN", _QMSProperties.TenBenhVien);
                string str2 = NgayIn(DateTime.Now);
                crpt_sokham.SetParameterValue("PrintDate", str2);
                crpt_sokham.SetParameterValue("TenKhoa", Utility.sDbnull(tenkhoa));
                crpt_sokham.SetParameterValue("LoaiDoiTuong", val);
                if (!string.IsNullOrEmpty(_QMSProperties.PrinterName))
                {
                    crpt_sokham.PrintOptions.PrinterName = Utility.sDbnull(_QMSProperties.PrinterName);
                }
                crpt_sokham.PrintToPrinter(1, false, 0, 0);
                UIAction._EnableControl(button, true, "");
                button.Focus();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi in số khám\n" + ex.Message);
            }
            finally
            {
                UIAction._EnableControl(button, true, "");
            }
        }
Example #3
0
        private void InPhieuKham(string tenkhoa, Button button, string sokham, int isUuTien)
        {
            try
            {

                string val = "BỆNH NHÂN THƯỜNG";
                if (ma_KhoaKcb == "KKB")
                {
                    val = (isUuTien == 0) ? "BỆNH NHÂN THƯỜNG" : "BỆNH NHÂN ƯU TIÊN";
                }

                UIAction._EnableControl(button, false, "");
                DataTable dataTable = new DataTable();
                Utility.AddColumToDataTable(ref dataTable, "So_Kham", typeof(string));
                DataRow row = dataTable.NewRow();
                row["So_Kham"] = Utility.sDbnull(sokham);
                dataTable.Rows.Add(row);
                CRPT_SOKHAM crpt_sokham = new CRPT_SOKHAM();
                crpt_sokham.SetDataSource(dataTable);
                crpt_sokham.SetParameterValue("TEN_BENH_VIEN", _QMSProperties.TenBenhVien);
                string str2 = NgayIn(DateTime.Now);
                crpt_sokham.SetParameterValue("PrintDate", str2);
                crpt_sokham.SetParameterValue("TenKhoa", Utility.sDbnull(tenkhoa));
                crpt_sokham.SetParameterValue("LoaiDoiTuong", val);
                if (!string.IsNullOrEmpty(_QMSProperties.PrinterName))
                {
                    crpt_sokham.PrintOptions.PrinterName = Utility.sDbnull(_QMSProperties.PrinterName);
                }
                crpt_sokham.PrintToPrinter(1, false, 0, 0);
                UIAction._EnableControl(button, true, "");
                button.Focus();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi in số khám\n" + ex.Message);
            }
            finally
            {
                UIAction._EnableControl(button, true, "");
            }
        }