private void btn_Submit_Click(object sender, EventArgs e) { // code xu ly them thuoc moi Medicine mdc = new Medicine(); //mdc.ID_Medicine = Convert.ToInt32(textBox_MedicineID.Text); mdc.Name = textBox_MedicineName.Text; mdc.Uses = textBox_Uses.Text; mdc.Price = Convert.ToInt32(textBox_Price.Text); mdc.TotalInventory = Convert.ToInt32(textBox_Inventory.Text); mdc.Note = textBox_Note.Text; mdc.MostUsedMonth = textBox_MostUsed.Text; mdc.MedicineGroup = UcQuanLyThuoc.medicineGroup; if (comboBox_MedicineGroup.SelectedIndex != -1) { mdc.MedicineGroup = comboBox_MedicineGroup.SelectedItem.ToString(); } mdc.Unit = UcQuanLyThuoc.unit; if (comboBox_Unit.SelectedIndex != -1) { mdc.Unit = comboBox_Unit.SelectedItem.ToString(); } ctrl.Insert(mdc); // thong bao thanh cong MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); // dong form Close(); }