Beispiel #1
0
 public static QMSProperties GetQMSProperties()
 {
     try
     {
         if (!System.IO.Directory.Exists(globalVariables.m_strPropertiesFolder))
         {
             Directory.CreateDirectory(globalVariables.m_strPropertiesFolder);
         }
         var    myProperty = new QMSProperties();
         string filePath   = string.Format(@"{0}\{1}.xml", globalVariables.m_strPropertiesFolder, myProperty.GetType().Name);
         if (!File.Exists(filePath))
         {
             return(myProperty);
         }
         var myFileStream = new FileStream(filePath, FileMode.Open);
         var mySerializer = new XmlSerializer(myProperty.GetType());
         myProperty = (QMSProperties)mySerializer.Deserialize(myFileStream);
         myFileStream.Close();
         return(myProperty);
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Lỗi khi đọc cấu hình Properties\n" + ex.Message);
         return(new QMSProperties());
     }
 }
Beispiel #2
0
        public frm_SoKham()
        {
            globalVariables.m_strPropertiesFolder = Application.StartupPath + @"\Properties\";
            if (!new ConnectionSQL().ReadConfig())
            {
                Try2ExitApp();
                return;
            }
            InitializeComponent();
            globalVariables.m_strPropertiesFolder = Application.StartupPath;
            _QMSProperties = GetQMSProperties();
            this.KeyDown += new KeyEventHandler(frm_SoKham_KeyDown);
            Utility.InitSubSonic(new ConnectionSQL().KhoiTaoKetNoi(), "ORM");
            this.Load+=new EventHandler(frm_SoKham_Load);
            CauHinh();
            this.cmdGetSoKham.Click += new EventHandler(this.cmdGetSoKham_Click);
            cmdgetBHYT.Click += new EventHandler(cmdgetBHYT_Click);
            this.cmdKhamUuTien.Click += new EventHandler(this.cmdKhamUuTien_Click);
            this.cmdKhamYC.Click += new EventHandler(this.cmdKhamYC_Click);

            chkLaythemsoYC.CheckedChanged += new EventHandler(chkLaythemsoYC_CheckedChanged);
            chkLaythemsothuong.CheckedChanged += new EventHandler(chkLaythemsothuong_CheckedChanged);
            chkLaythemsouutien.CheckedChanged += new EventHandler(chkLaythemsouutien_CheckedChanged);

            nmrLaythemsothuong.ValueChanged += new EventHandler(nmrLaythemsothuong_ValueChanged);
            nmrLaythemsoUutien.ValueChanged += new EventHandler(nmrLaythemsoUutien_ValueChanged);
            nmrLaythemsoYC.ValueChanged += new EventHandler(nmrLaythemsoYC_ValueChanged);

            cmdConfig.Click+=new EventHandler(cmdConfig_Click);
            mnuReprint.Click += mnuReprint_Click;

            chkLaythemsokhac.CheckedChanged += chkLaythemsokhac_CheckedChanged;
            nmrLaythemsokhac.ValueChanged += nmrLaythemsokhac_ValueChanged;
            cmdSotiemchung.Click += cmdSotiemchung_Click;
        }
Beispiel #3
0
 public void Init(DataTable dtBuongkham, DataTable dtSttKham , int id_khoakcb, QMSProperties _QMSProperties, string ma_doituong_kcb)
 {
     this.id_khoakcb = id_khoakcb;
     this.ma_doituong_kcb = ma_doituong_kcb;
     this._QMSProperties = _QMSProperties;
     this.dtBuongkham = dtBuongkham;
     this.dtSttKham = dtSttKham;
     InitControl();
 }
Beispiel #4
0
 public ucQMSItem(int id_KhoaKcb,string ma_KhoaKcb, int id_kieukham, int id_phongkham, int id_dichvukcb,string tenhienthi, QMSProperties _QMSProperties, string ma_doituong_kcb, int SoUutien)
 {
     InitializeComponent();
     InitEvents();
     this.tenhienthi = tenhienthi;
     this._QMSProperties = _QMSProperties;
     this.id_dichvukcb = id_dichvukcb;
     this.ma_KhoaKcb = ma_KhoaKcb;
     setControlProperties();
     cmdGetQMS.Text = tenhienthi;
     this.id_KhoaKcb = id_KhoaKcb;
     this.id_kieukham = id_kieukham;
     this.id_phongkham = id_phongkham;
     this.ma_doituong_kcb = ma_doituong_kcb;
     this.SoUutien = SoUutien;
 }
Beispiel #5
0
 public frm_QMS()
 {
     globalVariables.m_strPropertiesFolder = Application.StartupPath + @"\Properties\";
     if (!new ConnectionSQL().ReadConfig())
     {
         Try2ExitApp();
         return;
     }
     InitializeComponent();
     tabkhoaKcb.TabPages.Clear();
     globalVariables.m_strPropertiesFolder = Application.StartupPath;
     _QMSProperties = GetQMSProperties();
     this.KeyDown += new KeyEventHandler(frm_QMS_KeyDown);
     Utility.InitSubSonic(new ConnectionSQL().KhoiTaoKetNoi(), "ORM");
     this.Load+=new EventHandler(frm_QMS_Load);
     CauHinh();
     cmdConfig.Click+=new EventHandler(cmdConfig_Click);
 }
Beispiel #6
0
 public frm_QMS()
 {
     globalVariables.m_strPropertiesFolder = Application.StartupPath + @"\Properties\";
     if (!new ConnectionSQL().ReadConfig())
     {
         Try2ExitApp();
         return;
     }
     InitializeComponent();
     tabkhoaKcb.TabPages.Clear();
     globalVariables.m_strPropertiesFolder = Application.StartupPath;
     _QMSProperties = GetQMSProperties();
     this.KeyDown  += new KeyEventHandler(frm_QMS_KeyDown);
     Utility.InitSubSonic(new ConnectionSQL().KhoiTaoKetNoi(), "ORM");
     this.Load += new EventHandler(frm_QMS_Load);
     CauHinh();
     cmdConfig.Click += new EventHandler(cmdConfig_Click);
 }
Beispiel #7
0
 public static QMSProperties GetQMSProperties()
 {
     try
     {
         if (!System.IO.Directory.Exists(globalVariables.m_strPropertiesFolder))
         {
             Directory.CreateDirectory(globalVariables.m_strPropertiesFolder);
         }
         var myProperty = new QMSProperties();
         string filePath = string.Format(@"{0}\{1}.xml", globalVariables.m_strPropertiesFolder, myProperty.GetType().Name);
         if (!File.Exists(filePath)) return myProperty;
         var myFileStream = new FileStream(filePath, FileMode.Open);
         var mySerializer = new XmlSerializer(myProperty.GetType());
         myProperty = (QMSProperties)mySerializer.Deserialize(myFileStream);
         myFileStream.Close();
         return myProperty;
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Lỗi khi đọc cấu hình Properties\n"+ex.Message);
         return new QMSProperties();
     }
 }
Beispiel #8
0
        public frm_SoKham()
        {
            globalVariables.m_strPropertiesFolder = Application.StartupPath + @"\Properties\";
            if (!new ConnectionSQL().ReadConfig())
            {
                Try2ExitApp();
                return;
            }
            InitializeComponent();
            globalVariables.m_strPropertiesFolder = Application.StartupPath;
            _QMSProperties = GetQMSProperties();
            this.KeyDown  += new KeyEventHandler(frm_SoKham_KeyDown);
            Utility.InitSubSonic(new ConnectionSQL().KhoiTaoKetNoi(), "ORM");
            this.Load += new EventHandler(frm_SoKham_Load);
            CauHinh();
            this.cmdGetSoKham.Click  += new EventHandler(this.cmdGetSoKham_Click);
            cmdgetBHYT.Click         += new EventHandler(cmdgetBHYT_Click);
            this.cmdKhamUuTien.Click += new EventHandler(this.cmdKhamUuTien_Click);
            this.cmdKhamYC.Click     += new EventHandler(this.cmdKhamYC_Click);

            chkLaythemsoYC.CheckedChanged     += new EventHandler(chkLaythemsoYC_CheckedChanged);
            chkLaythemsothuong.CheckedChanged += new EventHandler(chkLaythemsothuong_CheckedChanged);
            chkLaythemsouutien.CheckedChanged += new EventHandler(chkLaythemsouutien_CheckedChanged);

            nmrLaythemsothuong.ValueChanged += new EventHandler(nmrLaythemsothuong_ValueChanged);
            nmrLaythemsoUutien.ValueChanged += new EventHandler(nmrLaythemsoUutien_ValueChanged);
            nmrLaythemsoYC.ValueChanged     += new EventHandler(nmrLaythemsoYC_ValueChanged);

            cmdConfig.Click  += new EventHandler(cmdConfig_Click);
            mnuReprint.Click += mnuReprint_Click;


            chkLaythemsokhac.CheckedChanged += chkLaythemsokhac_CheckedChanged;
            nmrLaythemsokhac.ValueChanged   += nmrLaythemsokhac_ValueChanged;
            cmdSotiemchung.Click            += cmdSotiemchung_Click;
            cmdSotiemchung_uutien.Click     += cmdSotiemchung_uutien_Click;
        }
Beispiel #9
0
        public void Init(DataRow dr,int id_KhoaKcb, int id_kieukham, int id_phongkham, string tenhienthi, QMSProperties _QMSProperties, string ma_doituong_kcb, int SoUutien)
        {
            this._QMSProperties = _QMSProperties;
            this.tenhienthi = tenhienthi;
            setControlProperties();
            cmdGetQMS.Text = tenhienthi;
            this.id_KhoaKcb = id_KhoaKcb;
            this.id_kieukham = id_kieukham;
            this.id_phongkham = id_phongkham;
            this.ma_doituong_kcb = ma_doituong_kcb;
            this.SoUutien = SoUutien;

            if (dr == null)
                UIAction.SetText(lblQMSNumber, "0");
            else
            {
                string str = Utility.sDbnull(dr["STT_KHAM"], "0");
                if (Utility.Int32Dbnull(dr["STT_KHAM"], 0) < 10)
                {
                    str = Utility.FormatNumberToString(Utility.Int32Dbnull(dr["STT_KHAM"], 0), "00");
                }
                UIAction.SetText(lblQMSNumber, str);
            }
            hasLoaded = true;
        }