private void MDI_Load(object sender, EventArgs e) { if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\rms_connect")) { Settings obj = new Settings(); MainClass.showWindow(obj, this); } else { Login ls = new Login(); MainClass.showWindow(ls, MDI.ActiveForm); } }
private void loginBtn_Click(object sender, EventArgs e) { Dashboard db = new Dashboard(); MainClass.showWindow(db, this, MDI.ActiveForm); }
private void saveBtn_Click(object sender, EventArgs e) { if (integratedSecuritycheckBox.Checked) { if (serverTbox.Text == "") { serverErrorLable.Visible = true; } else { serverErrorLable.Visible = false; } if (databaseTBox.Text == "") { databaseErrorLabel.Visible = true; } else { databaseErrorLabel.Visible = false; } if (serverErrorLable.Visible || databaseErrorLabel.Visible) { MainClass.showMessage("Fields with * are Mandetory", "Error"); } else { connection = "data source=" + serverTbox.Text + ";Initial catalog=" + databaseTBox.Text + ";integrated security=true;multipleactiveresultsets=true;"; saveConnection(); DialogResult dr = MessageBox.Show("Setting Saved Successfully"); if (dr == DialogResult.OK) { Login ls = new Login(); MainClass.showWindow(ls, this, MDI.ActiveForm); } } } else { if (serverTbox.Text == "") { serverErrorLable.Visible = true; } else { serverErrorLable.Visible = false; } if (databaseTBox.Text == "") { databaseErrorLabel.Visible = true; } else { databaseErrorLabel.Visible = false; } if (uNameTBox.Text == "") { usernameErrorLable.Visible = true; } else { usernameErrorLable.Visible = false; } if (passwordTBox.Text == "") { passwordErrorLabel.Visible = true; } else { passwordErrorLabel.Visible = false; } if (serverErrorLable.Visible || databaseErrorLabel.Visible || usernameErrorLable.Visible || passwordErrorLabel.Visible) { MainClass.showMessage("Fields with * are Mandetory", "Error"); } else { connection = "data source=" + serverTbox.Text + ";Initial catalog=" + databaseTBox.Text + ";User ID=" + uNameTBox.Text + ";Password="******";multipleactiveresultsets=true;"; updateConfigFile(connection); DialogResult dr = MessageBox.Show("Setting Saved Successfully"); if (dr == DialogResult.OK) { Login ls = new Login(); MainClass.showWindow(ls, this, MDI.ActiveForm); } } } }
private void backPicBox_Click(object sender, EventArgs e) { Dashboard db = new Dashboard(); MainClass.showWindow(db, MDI.ActiveForm); }
private void customerBtn_Click(object sender, EventArgs e) { Customers db = new Customers(); MainClass.showWindow(db, this, MDI.ActiveForm); }
private void roleBtn_Click(object sender, EventArgs e) { Roles db = new Roles(); MainClass.showWindow(db, this, MDI.ActiveForm); }