예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string type  = txttype.Text.Trim();
            string name  = txtname.Text.Trim();
            string price = txtPrice.Text.Trim();

            if (type == "" || name == "" || price == "")
            {
                MessageBox.Show("Hamisini doldur", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            Medicine medicine = new Medicine {
                Type = type, Name = name, Price = price + "  Azn"
            };

            _pharmacy.AddMedicine(medicine);
            dgvList.DataSource = null;
            dgvList.DataSource = _pharmacy.GetMedicines();
            txttype.Text       = "";

            txtname.Text  = "";
            txtPrice.Text = "";
        }
 public void AddMedicine(Medicine m)
 {
     medicines.Add(m);
 }