Ejemplo n.º 1
0
        public override void edit_Btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (TID_textBox.Text == "") { TID_errorlabel.Visible = true; } else { TID_errorlabel.Visible = false; }
                if (name_textBox.Text == "") { TName_errorlabel.Visible = true; } else { TName_errorlabel.Visible = false; }
                if (GenderDD.SelectedIndex == -1) { GenderDD_errorlabel.Visible = true; } else { GenderDD_errorlabel.Visible = false; }
                if (Phone_textBox.Text == "") { phone_errorlabel.Visible = true; } else { phone_errorlabel.Visible = false; }
                if (ClassDD.SelectedIndex == -1) { class_errorlabel.Visible = true; } else { class_errorlabel.Visible = false; }
                if (Address_textBox.Text == "") { address_errorlabel.Visible = true; } else { address_errorlabel.Visible = false; }

                if (TID_errorlabel.Visible || TName_errorlabel.Visible || GenderDD_errorlabel.Visible || phone_errorlabel.Visible || class_errorlabel.Visible || address_errorlabel.Visible)

                {
                    MainClass.MSGBox("Fields * are Mandatory", "Fill all Fields", "ERROR");
                }
                else
                {
                    TeacherDB teacherDB = new TeacherDB();
                    teacherDB.Edit(TID_textBox, name_textBox, GenderDD, Phone_textBox, ClassDD, Address_textBox);
                    MainClass.reset_disable(panel4);
                    ShowData();
                }
                Disable_errorlabel();
            }
            catch
            {
                MainClass.MSGBox("Oops... Teacher Not Updated", "Error", "Error");
            }

        }
Ejemplo n.º 2
0
        //Edit Button
        public override void edit_Btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (classesname_textBox.Text == "")
                {
                    classname_errorlabel.Visible = true;
                }
                else
                {
                    classname_errorlabel.Visible = false;
                }

                if (classname_errorlabel.Visible)
                {
                    MainClass.MSGBox("Fields * are Mandatory", "Fill all Fields", "ERROR");
                }
                else
                {
                    ClassDB classDB = new ClassDB();
                    classDB.edit(classesname_textBox);
                    MainClass.reset_disable(panel4);
                    ShowData();
                }
                Disable_errorlabel();
            }
            catch
            {
                MainClass.MSGBox("Oops... Class Not Updated", "Error", "Error");
            }
        }
Ejemplo n.º 3
0
        //Add Button
        public override void add_Btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (classesname_textBox.Text == "")
                {
                    classname_errorlabel.Visible = true;
                }
                else
                {
                    classname_errorlabel.Visible = false;
                }

                if (classname_errorlabel.Visible)
                {
                    MainClass.MSGBox("Fields * are Mandatory", "Fill all Fields", "ERROR");
                }
                else
                {
                    ClassDB classDB = new ClassDB();
                    classDB.add(classesname_textBox);
                    MainClass.reset_disable(panel4);
                    ShowData();
                }
                Disable_errorlabel();
            }
            catch
            {
                MainClass.MSGBox("Something Went Wrong", "ERROR", "ERROR");
            }
        }
Ejemplo n.º 4
0
        public override void add_Btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserID_textBox.Text == "")
                {
                    UID_errorlabel.Visible = true;
                }
                else
                {
                    UID_errorlabel.Visible = false;
                }
                if (username_textBox.Text == "")
                {
                    UName_errorlabel.Visible = true;
                }
                else
                {
                    UName_errorlabel.Visible = false;
                }
                if (userpswd_textBox.Text == "")
                {
                    UPswd_errorlabel.Visible = true;
                }
                else
                {
                    UPswd_errorlabel.Visible = false;
                }
                if (upswdrtype_textBox.Text == "")
                {
                    uretypepswd_errorlabel.Visible = true;
                }
                else
                {
                    uretypepswd_errorlabel.Visible = false;
                }
                if (upswdrtype_textBox.Text != userpswd_textBox.Text)
                {
                    mismatched_label.Visible = true;
                }
                else
                {
                    mismatched_label.Visible = false;
                }

                if (UID_errorlabel.Visible || UName_errorlabel.Visible || UPswd_errorlabel.Visible || uretypepswd_errorlabel.Visible || mismatched_label.Visible)
                {
                    MainClass.MSGBox("Fields * are Mandatory", "Fill all Fields", "ERROR");
                }
                else
                {
                    UsersDB usersDB = new UsersDB();
                    usersDB.Add(UserID_textBox, username_textBox, userpswd_textBox);
                    MainClass.reset_disable(panel4);
                    ShowData();
                }
                Disable_errorlabel();
            }
            catch
            {
                MainClass.MSGBox("Something Went Wrong", "ERROR", "ERROR");
            }
        }
Ejemplo n.º 5
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");
            }
        }
Ejemplo n.º 6
0
        public override void add_Btn_Click(object sender, EventArgs e)
        {
            try
            {
                if (SID_textBox.Text == "")
                {
                    SID_errorlabel.Visible = true;
                }
                else
                {
                    SID_errorlabel.Visible = false;
                }
                if (name_textBox.Text == "")
                {
                    SName_errorlabel.Visible = true;
                }
                else
                {
                    SName_errorlabel.Visible = false;
                }
                if (GenderDD.SelectedIndex == -1)
                {
                    GenderDD_errorlabel.Visible = true;
                }
                else
                {
                    GenderDD_errorlabel.Visible = false;
                }
                if (DOB_Picker.Text == "")
                {
                    DOB_errorlabel.Visible = true;
                }
                else
                {
                    DOB_errorlabel.Visible = false;
                }
                if (Phone_textBox.Text == "")
                {
                    phone_errorlabel.Visible = true;
                }
                else
                {
                    phone_errorlabel.Visible = false;
                }
                if (ClassDD.SelectedIndex == -1)
                {
                    class_errorlabel.Visible = true;
                }
                else
                {
                    class_errorlabel.Visible = false;
                }

                if (SID_errorlabel.Visible || SName_errorlabel.Visible || GenderDD_errorlabel.Visible || DOB_errorlabel.Visible || phone_errorlabel.Visible || class_errorlabel.Visible)
                {
                    MainClass.MSGBox("Fields * are Mandatory", "Fill all Fields", "ERROR");
                }
                else
                {
                    StudentDB studentDB = new StudentDB();
                    studentDB.Add(SID_textBox, name_textBox, GenderDD, DOB_Picker, Phone_textBox, ClassDD);
                    MainClass.reset_disable(panel4);
                    ShowData();
                }
                Disable_errorlabel();
            }
            catch (Exception ex)
            {
                MainClass.MSGBox(ex.Message, "ERROR", "ERROR");
            }
        }