Exemplo n.º 1
0
        // insereaza o noua sala
        private void button3_Click(object sender, EventArgs e)
        {
            using (AddClassRoom cr = new AddClassRoom())
            {

                if (cr.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {

                    if (bls.SearchIDS(cr.getID()))
                    {
                        MessageBox.Show("The ID already exists", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    }

                    else
                    {
                        bls.SetSVal(cr.getID(), cr.getNume(), cr.getResp());
                            if(bls.InsertS())
                            {
                                FillDataGrid();

                                bls.SetInv(cr.getID(),cr.getSc(),cr.getM(),cr.getC());

                                bls.InsertInvt();
                            }
                    }

                }

            }
        }
Exemplo n.º 2
0
        // modifica informatii despre o sala
        private void button4_Click(object sender, EventArgs e)
        {
            using (AddClassRoom ad = new AddClassRoom())
            {
                   ad.Class = int.Parse(dataGridView1.CurrentRow.Cells["ID_S"].Value.ToString());
                   if (ad.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                   {

                       bls.SetSVal(ad.getID(), ad.getNume(), ad.getResp());
                       bls.SetInv(ad.getID(), ad.getSc(), ad.getM(), ad.getC());

                       if (bls.UpdateS())
                       {
                           FillDataGrid();
                       }
                       else
                       {
                           MessageBox.Show("Error during Updating",
                              "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                       }
                   }
            }
        }