Ejemplo n.º 1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //INITIALIZE ENTITY OBJECT
                sObj = new Student();
                //ASSIGNING DATA TO sObj PROPERTIES
                sObj.RollNo = Convert.ToInt32(txtRollNo.Text);
                sObj.Name   = txtName.Text;
                sObj.Addr   = txtAddr.Text;


                //calling business layer
                bool res = sbl.DropStudent(sObj);
                if (res)
                {
                    System.Windows.Forms.MessageBox.Show(" Record Deleted Successfully ");
                }
            }
            catch (StudentException se)
            {
                System.Windows.Forms.MessageBox.Show(se.Message);
            }
            catch (Exception e1)
            {
                System.Windows.Forms.MessageBox.Show(e1.Message);
            }
        }
Ejemplo n.º 2
0
        private void btnDrop_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                sobj        = new Student();
                sobj.RollNo = Convert.ToInt32(txtRollNo_Copy.Text);

                bool re = sBl.DropStudent(sobj.RollNo);
                if (re)
                {
                    System.Windows.Forms.MessageBox.Show("RECORD DROPPED");
                }
            }

            catch (StudentException se)
            {
                System.Windows.Forms.MessageBox.Show(se.Message, "Student Management system");
            }
            catch (Exception e1)
            {
                System.Windows.Forms.MessageBox.Show(e1.Message, "Student Management system");
            }
        }
Ejemplo n.º 3
0
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         sbl         = new StudentBL();
         sobj        = new Student();
         sobj.RollNo = Int32.Parse(txtRollNo.Text);
         //sobj.Name = txtName.Text;
         //sobj.Addr = txtAddress.Text;
         bool res = sbl.DropStudent(sobj.RollNo);
         if (res)
         {
             System.Windows.Forms.MessageBox.Show("Record Deleted");
         }
     }
     catch (SMSException se)
     {
         System.Windows.Forms.MessageBox.Show(se.Message, "Student Management System");
     }
     catch (Exception e1)
     {
         System.Windows.Forms.MessageBox.Show(e1.Message, "Student Management System");
     }
 }