private void TxtDelete_Click(object sender, EventArgs e)
        {
            int delid = int.Parse(txtcomboBox.SelectedValue.ToString().Substring(0, 2).Trim());

            deldepo.DeleteMedicine(delid);
            txtcomboBox.DataSource = null;
            deldgvID.DataSource    = null;
            txtcomboBox.DataSource = deldepo.GetMedicines();
            deldgvID.DataSource    = deldepo.GetMedicines();
        }
 public Delete(Depo djepo, DataGridView dgv)
 {
     InitializeComponent();
     deldepo  = djepo;
     deldgvID = dgv;
     txtcomboBox.DataSource = deldepo.GetMedicines();
 }
示例#3
0
        public Form1()
        {
            InitializeComponent();
            Depo depo = new Depo("Med_Depo");

            gldepo           = depo;
            dgvID            = dataGridViewID;
            dgvID.DataSource = gldepo.GetMedicines();
        }
示例#4
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;
        }