private void FillComboBox() { DataTable table = new PharmacuticlesInfoBLL().LoadPharcuticalsTable(); cmbSupplierId.DataSource = table; cmbSupplierId.DisplayMember = "PharmaName"; cmbSupplierId.ValueMember = "PharmaID"; table = new MedicineInfoBLL().LoadMedicineInfoTable(); cmbMedicineID.DataSource = table; cmbMedicineID.DisplayMember = "MedicineName"; cmbMedicineID.ValueMember = "MedicineID"; }
private void loadTOModel() { obj=new MedicineInfo(); obj.MedicineID = txtID.Text; obj.MedicineBrandName = txtName.Text; obj.Contains = txtContains.Text; obj.Manufacturar = cmbPharma.SelectedValue.ToString(); obj.Dosage = cmbDosage.SelectedValue.ToString(); obj.Price = Convert.ToDecimal(txtPrice.Text); MedicineInfoBLL bllObj=new MedicineInfoBLL(); bllObj.SaveMedicine(obj); MessageBox.Show("Data successfully Saved!"); this.LoadMedicine(); }
private void btndelete_Click(object sender, EventArgs e) { obj = new MedicineInfo(); obj.MedicineID = txtID.Text; obj.MedicineBrandName = txtName.Text; obj.Contains = txtContains.Text; obj.Manufacturar = cmbPharma.SelectedValue.ToString(); obj.Dosage = cmbDosage.SelectedValue.ToString(); obj.Price = Convert.ToDecimal(txtPrice.Text); MedicineInfoBLL bllObj = new MedicineInfoBLL(); bllObj.DeleteMedicine(obj); MessageBox.Show("Data Deleted Successfully"); this.LoadMedicine(); }