private void Loginbtn_Click(object sender, EventArgs e)
 {
     if (usernameTxt.Text == null || usernameTxt.Text == "Enter Username")
     {
         usErrorLable.Visible = true;
     }
     else
     {
         usErrorLable.Visible = false;
     }
     if (passwordTxt.Text == null || passwordTxt.Text == "Password")
     {
         PAssErrorLable.Visible = true;
     }
     else
     {
         PAssErrorLable.Visible = false;
     }
     if (usErrorLable.Visible || PAssErrorLable.Visible)
     {
         MainClass.ShowMSG("Fields with * are required ", "Required", "Error");
     }
     else
     {
         if (Main.staffLogin(usernameTxt.Text, passwordTxt.Text))
         {
             HomeScreen HS = new HomeScreen();
             MainClass.showwindows(HS, this, MDI.ActiveForm);
         }
         else
         {
             MainClass.ShowMSG("Invalid Login Details", "Error", "Error");
         }
     }
 }
Example #2
0
        private void backBtn_Click(object sender, EventArgs e)
        {
            HomeScreen HS = new HomeScreen();

            MainClass.showwindows(HS, this, MDI.ActiveForm);
        }
        private void logoutBtn_Click_1(object sender, EventArgs e)
        {
            Login logscrn = new Login();

            MainClass.showwindows(logscrn, this, MDI.ActiveForm);
        }
Example #4
0
        private void Savebtn_Click(object sender, EventArgs e)
        {
            StringBuilder SB = new StringBuilder();

            if (Integrated_Security_CB.Checked) // if Integrated_Security_CB is check then run this part;
            {
                if (Data_SourceTxT.Text == "")
                {
                    DS_error_label.Visible = true;
                }
                else
                {
                    DS_error_label.Visible = false;
                }
                if (Data_baseTxT.Text == "")
                {
                    DB_error_label.Visible = true;
                }
                else
                {
                    DB_error_label.Visible = false;
                }
                if (DS_error_label.Visible || DB_error_label.Visible) //if all input feilds are not filled then run;
                {
                    MessageBox.Show("Feilds with * are Required");
                }
                else //if all input feilds are filled then connection generate;
                {
                    SB.Append("Data Source = " + Data_SourceTxT.Text + ";Initial Catalog = " + Data_baseTxT.Text + ";Integrated Security=true;MultipleActiveResultSets=true"); //window auth
                    File.WriteAllText(MainClass.path + "\\connect", SB.ToString());
                    DialogResult DR = MessageBox.Show("Settings saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (DR == DialogResult.OK)
                    {
                        Login logscrn = new Login();
                        MainClass.showwindows(logscrn, this, MDI.ActiveForm);
                    }
                }
            }
            else // if Integrated_Security_CB is not check then run this part;
            {
                if (Data_SourceTxT.Text == "")
                {
                    DS_error_label.Visible = true;
                }
                else
                {
                    DS_error_label.Visible = false;
                }
                if (Data_baseTxT.Text == "")
                {
                    DB_error_label.Visible = true;
                }
                else
                {
                    DB_error_label.Visible = false;
                }
                if (User_nameTxT.Text == "")
                {
                    UN_error_label.Visible = true;
                }
                else
                {
                    UN_error_label.Visible = false;
                }
                if (pass_wordTxT.Text == "")
                {
                    PSW_error_label.Visible = true;
                }
                else
                {
                    PSW_error_label.Visible = false;
                }
                if (DS_error_label.Visible || DB_error_label.Visible || UN_error_label.Visible || PSW_error_label.Visible)//if all input feilds are not filled then run;
                {
                    MessageBox.Show("Feilds with * are Required");
                }
                else //if all input feilds are filled then connect generate;
                {
                    SB.Append("Data Source = " + Data_SourceTxT.Text + ";Initial Catalog = " + Data_baseTxT.Text + ";User ID = " + User_nameTxT.Text + ";Password = "******";MultipleActiveResultSets=true"); //sql auth
                    File.WriteAllText(MainClass.path + "\\connect", SB.ToString());
                    DialogResult DR = MessageBox.Show("Settings saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (DR == DialogResult.OK)
                    {
                        Login logscrn = new Login();
                        MainClass.showwindows(logscrn, this, MDI.ActiveForm);
                    }
                }
            }
        }
Example #5
0
        private void ShiftBtn_Click(object sender, EventArgs e)
        {
            Shifts Shift = new Shifts();

            MainClass.showwindows(Shift, this, MDI.ActiveForm);
        }
Example #6
0
        private void ClassTiminglabel_Click(object sender, EventArgs e)
        {
            ClassTiming CT = new ClassTiming();

            MainClass.showwindows(CT, this, MDI.ActiveForm);
        }
Example #7
0
        private void NOTIFICATIONSBTN_Click(object sender, EventArgs e)
        {
            Notification Noti = new Notification();

            MainClass.showwindows(Noti, this, MDI.ActiveForm);
        }
Example #8
0
        private void ROLESbtn_Click(object sender, EventArgs e)
        {
            Roles role = new Roles();

            MainClass.showwindows(role, this, MDI.ActiveForm);
        }
Example #9
0
        private void SUBJECTBTN_Click(object sender, EventArgs e)
        {
            Subjects sub = new Subjects();

            MainClass.showwindows(sub, this, MDI.ActiveForm);
        }
Example #10
0
        private void STAFFBTN_Click(object sender, EventArgs e)
        {
            Staff staf = new Staff();

            MainClass.showwindows(staf, this, MDI.ActiveForm);
        }
Example #11
0
        private void PERIODSBTN_Click(object sender, EventArgs e)
        {
            Periods peri = new Periods();

            MainClass.showwindows(peri, this, MDI.ActiveForm);
        }
Example #12
0
        private void GROUPSBTN_Click(object sender, EventArgs e)
        {
            Groups grp = new Groups();

            MainClass.showwindows(grp, this, MDI.ActiveForm);
        }
Example #13
0
        private void SECTIONSBTN_Click(object sender, EventArgs e)
        {
            Sections sec = new Sections();

            MainClass.showwindows(sec, this, MDI.ActiveForm);
        }
Example #14
0
        private void Classesbtn_Click(object sender, EventArgs e)
        {
            Classes clas = new Classes();

            MainClass.showwindows(clas, this, MDI.ActiveForm);
        }
Example #15
0
        private void Addmissionbtn_Click(object sender, EventArgs e)
        {
            Addmission add = new Addmission();

            MainClass.showwindows(add, this, MDI.ActiveForm);
        }