Exemple #1
0
 public override void delete_Btn_Click(object sender, EventArgs e)
 {
     try
     {
         if (Num_textBox.Text == "")
         {
             MainClass.MSGBox("Enter Fee Id", "Error", "Error");
         }
         else
         {
             FeeDB feeDB = new FeeDB();
             feeDB.Delete(Num_textBox, StdID_DD, name_textBox, Period_picker, amount_textBox);
             MainClass.Disable(panel4);
             ShowData();
         }
     }
     catch
     {
         MainClass.MSGBox("Oopss... Student Not Deleted!!", "Error", "Error");
     }
     Disable_errorlabel();
 }
Exemple #2
0
        public override void edit_Btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (Num_textBox.Text == "")
                {
                    num_errorlabel.Visible = true;
                }
                else
                {
                    num_errorlabel.Visible = false;
                }
                if (StdID_DD.SelectedIndex == -1)
                {
                    SID_errorlabel.Visible = true;
                }
                else
                {
                    SID_errorlabel.Visible = false;
                }
                if (name_textBox.Text == "")
                {
                    name_errorlabel.Visible = true;
                }
                else
                {
                    name_errorlabel.Visible = false;
                }
                if (Period_picker.Text == "")
                {
                    period_errorlabel.Visible = true;
                }
                else
                {
                    period_errorlabel.Visible = false;
                }
                if (amount_textBox.Text == "")
                {
                    amount_errorlabel.Visible = true;
                }
                else
                {
                    amount_errorlabel.Visible = false;
                }

                if (num_errorlabel.Visible || SID_errorlabel.Visible || name_errorlabel.Visible || period_errorlabel.Visible || amount_errorlabel.Visible)

                {
                    MainClass.MSGBox("Fields * are Mandatory", "Fill all Fields", "ERROR");
                }
                else
                {
                    FeeDB feeDB = new FeeDB();
                    feeDB.Edit(Num_textBox, StdID_DD, name_textBox, Period_picker, amount_textBox);
                    MainClass.reset_disable(panel4);
                    ShowData();
                }
                Disable_errorlabel();
            }
            catch (Exception m)
            {
                MainClass.MSGBox(m.Message, "Error", "Error");
            }
        }