private void button1_Click(object sender, EventArgs e) { if (Usernametext.Text == "") { usernameerroelbl.Visible = true; } else { usernameerroelbl.Visible = false; } if (Passwordtext.Text == "") { passworderrorlbl.Visible = true; } else { passworderrorlbl.Visible = false; } if (usernameerroelbl.Visible || passworderrorlbl.Visible) { MainClass.ShowMSG("Fields with * are mandatory", "Stop", "Error"); //Error massage with main class } else { if (Retrival.getUserDetail(Usernametext.Text, Passwordtext.Text)) { HomeScreen obj = new HomeScreen(); MainClass.showWindow(obj, this, MDI.ActiveForm); } else { } } }
private void MDI_Load(object sender, EventArgs e) { string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); if (File.Exists(path + "\\dbconnect")) { Login log = new Login(); MainClass.showWindow(log, this); } else { Settings set = new Settings(); MainClass.showWindow(set, this); } }
private void Savebtn_Click(object sender, EventArgs e) { string s; string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); if (Intrgraradbtn.Checked) { if (Servertxt.Text != "" && Databasetxt.Text != "") { s = "Data Source=" + Servertxt.Text + ";Initial Catalog=" + Databasetxt.Text + ";Integrated Security=true;"; File.WriteAllText(path + "\\dbconnect", s); DialogResult dr = MessageBox.Show("settings Save Sucessfully....", "Information....", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dr == DialogResult.OK) { Login log = new Login(); MainClass.showWindow(log, this, MDI.ActiveForm); } } else { MessageBox.Show("please give complete data to continue.."); } } else { if (Servertxt.Text != "" && Databasetxt.Text != "" && Usertxt.Text != "" && Passwordtxt.Text != "") { s = "Data Source=" + Servertxt.Text + ";Initial Catalog=" + Databasetxt.Text + ";User ID=" + Usertxt.Text + ";password="******";"; File.WriteAllText(path + "\\dbconnect", s); DialogResult dr = MessageBox.Show("settings Save Sucessfully....", "Information....", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dr == DialogResult.OK) { Login log = new Login(); MainClass.showWindow(log, this, MDI.ActiveForm); } } else { MessageBox.Show("please give complete data to continue.."); } } }
private void aboutusToolStripMenuItem_Click(object sender, EventArgs e) { About ab = new About(); MainClass.showWindow(ab, this); }
private void settingsToolStripMenuItem_Click(object sender, EventArgs e) { Settings set = new Settings(); MainClass.showWindow(set, this); }
private void button1_Click(object sender, EventArgs e) { HomeScreen obj = new HomeScreen(); MainClass.showWindow(obj, this, MDI.ActiveForm); }
private void button3_Click(object sender, EventArgs e) { Stocks sd = new Stocks(); MainClass.showWindow(sd, this, MDI.ActiveForm); }
private void button7_Click(object sender, EventArgs e) { Login log = new Login(); MainClass.showWindow(log, this, MDI.ActiveForm); }
private void proDD_Click(object sender, EventArgs e) { products u = new products(); MainClass.showWindow(u, this, MDI.ActiveForm); }
private void catbtn_Click(object sender, EventArgs e) { Categories u = new Categories(); MainClass.showWindow(u, this, MDI.ActiveForm); }
private void button1_Click(object sender, EventArgs e) { Users u = new Users(); MainClass.showWindow(u, this, MDI.ActiveForm); }