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); }
private void frmConfig_Load(object sender, EventArgs e) { _cfgDto = ConfigBUS.GetConfig(); //Tich Luy Diem chbxTichLuyDiem.Checked = _cfgDto.TichLuyDiem; }
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); } }
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; } }
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(); }
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); } }
private void GetSoLuongKhamTrongNgay() { ConfigBUS config = new ConfigBUS(); _soLuongKhamMax = config.GetGiaTriQuiDinh(_QD); }