Esempio n. 1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            string name  = txtname.Text.Trim();
            string type  = txtType.Text.Trim();
            string price = txtPrice.Text.Trim();

            if (name == null || type == null || price == null)
            {
                MessageBox.Show("Zehmet olmasa xanalari doldurun", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            Medicine medicine = new Medicine()
            {
                Name = name, Type = type, Price = price
            };

            gldepo.AddMedicine(medicine);
            dgvID.DataSource = null;
            dgvID.DataSource = gldepo.GetMedicines();
            txtname.Text     = null;
            txtType.Text     = null;
            txtPrice.Text    = null;
        }
Esempio n. 2
0
 public void AddMedicine(Medicine medicine)
 {
     medicines.Add(medicine);
 }