private void frmDrugManager_Load(object sender, EventArgs e) { //Set giao diện lúc load bMed = new bMedecine(); btnSave.Enabled = false; label2.Text = ""; dtpExp.CustomFormat = "dd-MM-yyyy"; //dtpExp.Format = DateTimePickerFormat.Custom; //Load dữ liệu lên combobox cboSupplier.DataSource = bMed.getAllSupplierName(); cboCategory.DataSource = bMed.getAllCategoriesName(); cboCountry.DataSource = bMed.getAllCountryName(); cboQuantityPerUnit.DataSource = bMed.getAllQuantityPerUnitName(); List <string> c = bMed.getAllCategoriesName(); c.Add("Tất cả thuốc"); cboCategoryPL.DataSource = c; List <string> s = bMed.getAllSupplierName(); s.Add("Tất cả nhà cung cấp"); cboSupplierPL.DataSource = s; cboCategoryPL.Text = "Tất cả thuốc"; cboSupplierPL.Text = "Tất cả nhà cung cấp"; //Load dữ liệu datagridview dgvMedList.DataSource = bMed.getAllMedecine(); FormatDataGridview(); setOnOffEditTextbox(0); }
private void frmDrugSearch_Load(object sender, EventArgs e) { bMed = new bMedecine(); dgvMed.DataSource = bMed.getAllMedecine(); FormatDataGridview(); rdoID.Checked = true; txtSearch.AutoCompleteMode = AutoCompleteMode.Suggest; txtSearch.AutoCompleteSource = AutoCompleteSource.CustomSource; }
private void frmExpiredDrugsStatistics_Load(object sender, EventArgs e) { bMed = new bMedecine(); //Thống kê số liệu label1.Text = bMed.getAllMedecine().Count.ToString(); lblExpiredDrug.Text = bMed.getExpiredMedecine().Count.ToString(); lblNearlyExpiredDrug.Text = bMed.getNearlyExpiredMedecine().Count.ToString(); dgvMedList.DataSource = bMed.getExpiredMedecine(); FormatDataGridview(); radioButton1.Checked = true; }
private void frmDrugSell_Load(object sender, EventArgs e) { bMed = new bMedecine(); bCus = new bCustomer(); bB = new bBill(); bBD = new bBillDetail(); medecineID = ""; medecineName = ""; //Load danh sách dgvMedList.DataSource = bMed.getAllMedecine(); FormatDataGridviewMed(); dgvCusList.DataSource = bCus.getAllCustomer(); FormatDataGridviewCus(); //Sử dụng AutoComplete txtSearch.AutoCompleteMode = AutoCompleteMode.Suggest; txtSearch.AutoCompleteSource = AutoCompleteSource.CustomSource; txtSearchCus.AutoCompleteMode = AutoCompleteMode.Suggest; txtSearchCus.AutoCompleteSource = AutoCompleteSource.CustomSource; foreach (eMedicine med in bMed.getAllMedecine()) { txtSearch.AutoCompleteCustomSource.Add(med.MedicineName); } foreach (eCustomer cus in bCus.getAllCustomer()) { txtSearchCus.AutoCompleteCustomSource.Add(cus.CustomerName); } //Định dạng form setOnOffEditTextbox(0); btnSave.Enabled = false; lblNotify.Text = ""; InsertColumnsListView(); txtTotalMoney.ReadOnly = true; txtTotalMoney.BackColor = System.Drawing.SystemColors.Window; btnCancelBill.Enabled = false; btnPay.Enabled = false; dgvMedList.ReadOnly = true; dgvCusList.ReadOnly = true; }