private void button1_Click(object sender, EventArgs e) { if (txt_username.Text == "") { errorlabelUsernme.Visible = true; } else { errorlabelUsernme.Visible = false; } if (txt_password.Text == "") { errorlabelpassword.Visible = true; } else { errorlabelpassword.Visible = false; } if (errorlabelpassword.Visible || errorlabelUsernme.Visible) { Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error.."); } else { if (mai.getStaffLogin(txt_username.Text, txt_password.Text)) { if (Mainclass.STAFFROLE == "Falculty") { FalcultyDashboard hs = new FalcultyDashboard(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); } if (Mainclass.STAFFROLE == "Admin") { Home hs = new Home(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); } if (Mainclass.STAFFROLE == "Teacher") { } if (Mainclass.STAFFROLE == "Principal") { } } else { Mainclass.ShowMsg("Invalid Login Details", "Error...", "Error.."); } } }
private void label3_Click(object sender, EventArgs e) { Home hs = new Home(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button17_Click(object sender, EventArgs e) { Assignment hs = new Assignment(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button16_Click(object sender, EventArgs e) { Period hs = new Period(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button7_Click(object sender, EventArgs e) { Stafff hs = new Stafff(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button1_Click(object sender, EventArgs e) { Classes hs = new Classes(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button13_Click(object sender, EventArgs e) { Shift hs = new Shift(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button12_Click(object sender, EventArgs e) { House hs = new House(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button2_Click(object sender, EventArgs e) { Sections hs = new Sections(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button14_Click(object sender, EventArgs e) { Level hs = new Level(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button5_Click(object sender, EventArgs e) { FeeVoucher hs = new FeeVoucher(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button18_Click(object sender, EventArgs e) { Fee_Structure hs = new Fee_Structure(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button11_Click(object sender, EventArgs e) { Admission hs = new Admission(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button6_Click(object sender, EventArgs e) { Timetable hs = new Timetable(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); }
private void button1_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); if (ISCB.Checked) { if (txt_datasource.Text == "") { errorlabledatasource.Visible = true; } else { errorlabledatasource.Visible = false; } if (txt_database.Text == "") { errorlabeldatabase.Visible = true; } else { errorlabeldatabase.Visible = false; } if (!errorlabeldatabase.Visible && !errorlabeldatabase.Visible) { MessageBox.Show("Fields with * are mandatory"); } else { sb.Append("Data Source=" + txt_datasource.Text + ";Initial Catalog=" + txt_database.Text + ";Integrated Security=true;MultipleActiveResultSets=true"); File.WriteAllText(main.path + "\\connect", sb.ToString()); DialogResult dr = MessageBox.Show("Settings Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dr == DialogResult.OK) { Login log = new Login(); Mainclass.showWindow(log, this, Mdi.ActiveForm); } } } else if (txt_datasource.Text == "") { errorlabledatasource.Visible = true; } else { errorlabledatasource.Visible = false; } if (txt_database.Text == "") { errorlabeldatabase.Visible = true; } else { errorlabeldatabase.Visible = false; } if (txt_username.Text == "") { errorlabelusername.Visible = true; } else { errorlabelusername.Visible = false; } if (txt_password.Text == "") { errorlabelpassword.Visible = true; } else { errorlabelpassword.Visible = false; } if (errorlabeldatabase.Visible || errorlabledatasource.Visible || errorlabelusername.Visible || errorlabelpassword.Visible) { MessageBox.Show("Fields with * are mandatory"); } else { sb.Append("Data Source=" + txt_datasource.Text + ";Initial Catalog=" + txt_database.Text + ";User ID=" + txt_username.Text + ";Password="******";MultipleActiveResultSets=true"); File.WriteAllText(main.path + "\\connect", sb.ToString()); DialogResult dr = MessageBox.Show("Settings Saved Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dr == DialogResult.OK) { Login log = new Login(); Mainclass.showWindow(log, this, Mdi.ActiveForm); } } }