private void logOutBt_Click(object sender, EventArgs e)
        {
            LogInPage logPage = new LogInPage();

            logPage.Show(); this.Hide();
            MesBox box = new MesBox(logPage, "Log-Out Successfull.. :)", true); box.Show();
        }
Example #2
0
        private void loginBT_Click(object sender, EventArgs e)
        {
            DataBase DB = new DataBase();

            if (DB.userAuth(unameTX.Text, passTX.Text))
            {
                if (DB.getUserType(unameTX.Text) == Convert.ToBoolean(GenProperty.UserType.Teacher))
                {
                    Session.setTeacher(unameTX.Text);
                    new TeacherHomePage().Show(); this.Hide();
                    Session.isTeacher = true;
                }
                else
                {
                    Session.isTeacher = false;
                    Session.setStudent(unameTX.Text);
                    new StudentHomePage().Show(); this.Hide();
                }
            }
            else
            {
                //MessageBox.Show("Wrong Username or Password..");
                MesBox box = new MesBox(this, "Wrong Username or Password.. :(", false);
                box.Show();
            }
        }
Example #3
0
        bool chkForm()
        {
            if (nameBx.Text.Equals(""))
            {
                //MessageBox.Show("Please Fill-up All Fields");
                MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
                return(false);
            }
            if (mailBx.Text.Equals(""))
            {
                //MessageBox.Show("Please Fill-up All Fields");
                MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
                return(false);
            }
            if (dateTime.Text.Equals(DateTime.Today.ToString("MMMM dd,  yyyy")))
            {
                //MessageBox.Show("Please Select Your Dath of Birth");
                MesBox box = new MesBox(this, "Please Select Your Dath of Birth.. :(", false); box.Show();
                return(false);
            }
            if (!mle.Checked && !fmle.Checked)
            {
                //MessageBox.Show("Please Select Your Gender");
                MesBox box = new MesBox(this, "Please Select Your Gender.. :(", false); box.Show();
                return(false);
            }
            if (instBx.Text.Equals(""))
            {
                //MessageBox.Show("Please Fill-up All Fields");
                MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
                return(false);
            }
            if (dptBx.Text.Equals(""))
            {
                //MessageBox.Show("Please Fill-up All Fields");
                MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
                return(false);
            }

            if (!pass1Bx.Text.Equals(pass2Bx.Text) || pass1Bx.Text.Equals(""))
            {
                //MessageBox.Show("Password Did not matched..!");
                if (pass1Bx.Text.Equals(pass2Bx.Text))
                {
                    MesBox box = new MesBox(this, "Sorry, Password can't be empty.. :(", false); box.Show();
                }
                else
                {
                    MesBox box = new MesBox(this, "Sorry, Password Did not matched.. :(", false); box.Show();
                    pass1Bx.Text = ""; pass2Bx.Text = "";
                }
                return(false);
            }
            return(true);
        }
Example #4
0
 bool chkForm()
 {
     if (nameBx.Text.Equals(""))
     {
         MesBox box = new MesBox(this, "Please enter the Course Name.. :(", false); box.Show();
         return(false);
     }
     if (mxstudentBx.Text.Equals(""))
     {
         MesBox box = new MesBox(this, "Please set the maximum student limit.. :(", false); box.Show();
         return(false);
     }
     if (descTexBx.Text.Equals(""))
     {
         MesBox box = new MesBox(this, "Please write some short description.. :(", false); box.Show();
         return(false);
     }
     return(true);
 }
Example #5
0
 private void submtBT_Click(object sender, EventArgs e)
 {
     if (chkForm())
     {
         if (techr.Checked)
         {
             bool    gen      = mle.Checked;
             Teacher aTeacher = new Teacher(IdBx.Text, nameBx.Text, mailBx.Text, dateTime.Value, gen, instBx.Text, dptBx.Text);
             aTeacher.getReg(pass1Bx.Text);
         }
         else
         {
             bool    gen      = mle.Checked;
             Student aStudent = new Student(IdBx.Text, nameBx.Text, mailBx.Text, dateTime.Value, gen);
             aStudent.getReg(pass1Bx.Text);
         }
         LogInPage logPage = new LogInPage(); logPage.Show(); this.Hide();
         MesBox    box     = new MesBox(logPage, "Registation Successfull.. :)", true); box.Show();
     }
 }
Example #6
0
 bool chkForm()
 {
     if (!stdnt.Checked && !techr.Checked)
     {
         //MessageBox.Show("Please Select Regester Type");
         MesBox box = new MesBox(this, "Please Select Register Type.. :(", false); box.Show();
         return(false);
     }
     if (nameBx.Text.Equals(""))
     {
         //MessageBox.Show("Please Fill-up All Fields");
         MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
         return(false);
     }
     if (mailBx.Text.Equals(""))
     {
         //MessageBox.Show("Please Fill-up All Fields");
         MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
         return(false);
     }
     if (IdBx.Text.Equals(""))
     {
         //MessageBox.Show("Please Fill-up All Fields");
         MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
         return(false);
     }
     if (dateTime.Text.Equals(DateTime.Today.ToString("MMMM dd,  yyyy")))
     {
         //MessageBox.Show("Please Select Your Dath of Birth");
         MesBox box = new MesBox(this, "Please Select Your Dath of Birth.. :(", false); box.Show();
         return(false);
     }
     if (!mle.Checked && !fmle.Checked)
     {
         //MessageBox.Show("Please Select Your Gender");
         MesBox box = new MesBox(this, "Please Select Your Gender.. :(", false); box.Show();
         return(false);
     }
     if (techr.Checked)
     {
         if (instBx.Text.Equals(""))
         {
             //MessageBox.Show("Please Fill-up All Fields");
             MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
             return(false);
         }
         if (dptBx.Text.Equals(""))
         {
             //MessageBox.Show("Please Fill-up All Fields");
             MesBox box = new MesBox(this, "Please Fill-up All Fields.. :(", false); box.Show();
             return(false);
         }
     }
     if (new DataBase().chkUser(IdBx.Text))
     {
         //MessageBox.Show("Username Already Exist :(");
         MesBox box = new MesBox(this, "Sorry, Username Already Exist.. :(", false); box.Show();
         IdBx.Text = ""; return(false);
     }
     if (!pass1Bx.Text.Equals(pass2Bx.Text) || pass1Bx.Text.Equals(""))
     {
         //MessageBox.Show("Password Did not matched..!");
         if (pass1Bx.Text.Equals(pass2Bx.Text))
         {
             MesBox box = new MesBox(this, "Sorry, Password can't be empty.. :(", false); box.Show();
         }
         else
         {
             MesBox box = new MesBox(this, "Sorry, Password Did not matched.. :(", false); box.Show();
             pass1Bx.Text = ""; pass2Bx.Text = "";
         }
         return(false);
     }
     return(true);
 }