public ConfigResponseModel GetConfig() { ConfigResponseModel model = new ConfigResponseModel(); using (connection = new MySqlConnection(conString)) { string xQry = "select * from config"; connection.Open(); MySqlCommand comm = new MySqlCommand(xQry, connection); MySqlDataReader reader = comm.ExecuteReader(); while (reader.Read()) { model = new ConfigResponseModel() { BackUpPath = reader.GetString("backup_path"), IsHms = reader.GetString("is_hms"), IsAccounts = reader.GetString("is_accounts"), IsBatch = reader.GetString("is_batch"), IsExpiry = reader.GetString("is_expiry"), IS_M_ProductnameInTamil = reader.GetString("is_m_product_name_in_tamil"), IS_M_HsnCode = reader.GetString("is_m_hsn_code"), IS_M_ProductCode = reader.GetString("is_m_product_code"), IS_M_ProductMrp = reader.GetString("is_m_product_mrp"), DefualtDoctor = reader.GetString("doctor_id") }; } connection.Close(); } return(model); }
private void OutPatientEntry_Load(object sender, EventArgs e) { this.KeyPreview = true; txtOpId.Text = xDb.GetMaxId("txno", "outpatientdetails").ToString(); cmbCaseType.Select(); LoadGrid(); cmbCaseType.SelectedIndex = 0; cmbNoonType.SelectedIndex = 0; cmbCaseType1.SelectedIndex = 0; cmbOpPatientStatus.SelectedIndex = 1; cmbPaymentStatus.SelectedIndex = 1; ConfigResponseModel configResponseModel = xDb.GetConfig(); DoctorResponseModel doctorResponseModel = xDb.GetDoctorFromDoctorId(Convert.ToInt32(configResponseModel.DefualtDoctor)); if (doctorResponseModel.DoctorId == 0) { MessageBox.Show("Could not Find Doctor Details"); } { txtDoctorId.Text = doctorResponseModel.DoctorId.ToString(); txtDoctorName.Text = doctorResponseModel.DoctorName; } txtFees.Text = "150"; GetMaxTokenNo(); }
private void Dashboard_Load(object sender, EventArgs e) { //PrintReceiptPage(sender, e); String xDate = DateTime.Now.ToString("yyyy-MM-dd"); DatabaseConnection xDb = new DatabaseConnection(); Backup xBackUp = new Backup(); ConfigResponseModel configResponse = xDb.GetConfig(); xBackUp.BackUpDatabase(configResponse.BackUpPath); BackUpResponseModel backupResponse = xDb.GetBackUpHistory(xDate); if (backupResponse.BackUpPath == null) { string xQry = "insert into backup (date,path) " + " values('" + xDate + "','" + configResponse.BackUpPath.Replace("\\", "\\\\") + "')"; xDb.DataProcess(xQry); } }
private void SearchPatient_Load(object sender, EventArgs e) { this.KeyPreview = true; //refer key activities xPatientId = 0; txtSearch.Select(); xDb.LoadGrid("select patient_id,uhid,patient_name as Name," + " patient_address as Address,patient_mobileno as MobileNo " + " from m_patient_registration", dataGridView1); dataGridView1.ReadOnly = true; dataGridView1.Columns[0].Visible = false; ConfigResponseModel configResponseModel = xDb.GetConfig(); if (configResponseModel.IsHms == "NO") { dataGridView1.Columns[1].Visible = false; } dataGridView1.Columns[2].FillWeight = 100; dataGridView1.Columns[3].FillWeight = 240; dataGridView1.Columns[4].FillWeight = 80; }