示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Magazine magazin = new Magazine();

            GrpBxMusic.Visible    = false;
            GrpBxBook.Visible     = false;
            grpBxMagazine.Visible = true;
            magazin.printProperties(dataGridView1);
            txtAddNewBook.Show();
            button6.Show();
            button7.Show();
        }
示例#2
0
        private void btnRemoveMagazine_Click(object sender, EventArgs e)
        {
            Magazine m = new Magazine();

            m.ID = int.Parse(dataGridView1.CurrentRow.Cells["Product_ID"].Value.ToString());
            try
            {
                magazineProvide.Delete_Magazine(m.ID);
                m.printProperties(dataGridView1);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
 private void btnMagazineAdd_Click(object sender, EventArgs e)
 {
     if (txtMagazinName.Text != "" && txtIssue.Text != "" && cmbMagazineType.Text != "" && txtMagazinePrice.Text != "")
     {
         GrpBxBook.Visible     = false;
         GrpBxMusic.Visible    = false;
         grpBxMagazine.Visible = true;
         Magazine magazin = new Magazine();
         magazin.name  = txtMagazinName.Text;
         magazin.Issue = int.Parse(txtIssue.Text);
         magazin.price = int.Parse(txtMagazinePrice.Text);
         magazin.Type  = cmbMagazineType.Text;
         magazin.InsertMagazine(magazin);
         magazin.printProperties(dataGridView1);
     }
     else
     {
         MessageBox.Show("Please fill in the blank fields", "Warning !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }