Ejemplo n.º 1
0
 private void frmConfig_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (_changed == true)
         {
             DialogResult result = MessageBox.Show("Cấu hình chưa được lưu. Vui lòng lưu cấu hình trước khi đóng",
                                                   "Question",
                                                   MessageBoxButtons.YesNoCancel,
                                                   MessageBoxIcon.Warning,
                                                   MessageBoxDefaultButton.Button1);
             if (result == DialogResult.Yes)
             {
                 e.Cancel = true;
                 ConfigBUS.SaveConfig(_cfgDto);
                 MessageBox.Show("Save config thành công");
                 _changed = false;
             }
             if (result == DialogResult.Cancel)
             {
                 e.Cancel = true;
             }
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void LoadTienKham()
        {
            ConfigBUS bus = new ConfigBUS();

            _tienKham  = bus.GetGiaTriQuiDinh(_qdTienKham);
            _tienThuoc = bus.GetGiaTriQuiDinh(_qdTienThuoc);
        }
Ejemplo n.º 3
0
        private void frmConfig_Load(object sender, EventArgs e)
        {
            _cfgDto = ConfigBUS.GetConfig();

            //Tich Luy Diem
            chbxTichLuyDiem.Checked = _cfgDto.TichLuyDiem;
        }
Ejemplo n.º 4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("Bạn có chắc là muốn cập nhật cấu hình phần mềm này không?",
                                                      "Question",
                                                      MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Question,
                                                      MessageBoxDefaultButton.Button1);
                if (result == DialogResult.Yes)
                {
                    Main2._cfgDto.TichLuyDiem = chbxTichLuyDiem.Checked;
                    Main2._cfgDto.UseAPISycn  = cbUseAPISync.Checked;
                    Main2._cfgDto.SoapAddress = txtSoapAddress.Text;

                    ConfigBUS.SaveConfig(Main2._cfgDto);

                    MessageBox.Show("Save config thành công");
                    _changed = false;

                    if (_isSoapChanged)
                    {
                        Main2.getSessionId();
                        _isSoapChanged = false;
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 5
0
        public static void getSessionId()
        {
            try
            {
                // login (make sure you have user and role assigned in magento admin)
                _cfgDto = ConfigBUS.GetConfig();
                apiUrl  = _cfgDto.SoapAddress;

                sessionId = Connection.Login(apiUrl, apiUser, apiPass);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Không thể kết nối tới web, sử dụng OFFLINE MODE");
                _cfgDto.UseAPISycn = false;
            }
        }
Ejemplo n.º 6
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            var config = new Config()
            {
                ServerName   = this.txtServerName.Text,
                DatabaseName = this.txtDatabaseName.Text,
                UserName     = this.txtUserName.Text,
                Password     = this.txtPassword.Text
            };

            if (checkBoxWindows.Checked == true)
            {
                ConfigBUS.WindowsAuthentication(config);
            }
            else
            {
                ConfigBUS.SQLSeverAuthentication(config);
            }
            this.Dispose();
        }
Ejemplo n.º 7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("Bạn có chắc là muốn cập nhật cấu hình phần mềm này không?",
                                                      "Question",
                                                      MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Question,
                                                      MessageBoxDefaultButton.Button1);
                if (result == DialogResult.Yes)
                {
                    _cfgDto.TichLuyDiem = chbxTichLuyDiem.Checked;

                    ConfigBUS.SaveConfig(_cfgDto);

                    MessageBox.Show("Save config thành công");
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 8
0
        private void GetSoLuongKhamTrongNgay()
        {
            ConfigBUS config = new ConfigBUS();

            _soLuongKhamMax = config.GetGiaTriQuiDinh(_QD);
        }