public BugDetail(SessionModule sm) { InitializeComponent(); session = sm; fillComboBox(); fillDevComboBox(); }
//connecting to the database and loading the windows private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\admin\Documents\BugHandler.mdf;Integrated Security=True;Connect Timeout=30"); SqlDataAdapter sda = new SqlDataAdapter("Select Role from Login where Username = '******' and Password = '******' ",con); DataTable dt = new System.Data.DataTable(); sda.Fill(dt); if(dt.Rows.Count == 1) { BugHandlerEntities1 bte = new BugHandlerEntities1(); var role = bte.Logins.Where(a => a.Username == textBox1.Text).SingleOrDefault(); SessionModule session = new SessionModule(); session.Username = role.Username; if (role.Role=="Admin") { BugHandlerAdmin bhs = new BugHandlerAdmin(session); this.Hide(); bhs.Show(); } else if (role.Role == "Client") { BugHandlerSoftware abc = new BugHandlerSoftware(session); this.Hide(); abc.Show(); } else { BugHandlerProgrammer bhp = new BugHandlerProgrammer(session); this.Hide(); bhp.Show(); } } //to display error in wrong password else { MessageBox.Show("Incorrect Username or Password!"); } }
public ViewBug(SessionModule sm) { InitializeComponent(); session = sm; fillComboBox(); }
//setting parameters public InsertBug(SessionModule sm) { InitializeComponent(); session = sm; }
public BugSolution(SessionModule sm) { InitializeComponent(); session = sm; fillComboBox(); }
//setting parameters public BugHandlerSoftware(SessionModule xyz) { InitializeComponent(); session = xyz; }
public BugHandlerAdmin(SessionModule sm) { InitializeComponent(); }
//setting parameters public BugHandlerProgrammer(SessionModule sm) { InitializeComponent(); session = sm; }