コード例 #1
0
ファイル: BugDetail.cs プロジェクト: koolrik/BugHandler
 public BugDetail(SessionModule sm)
 {
     InitializeComponent();
     session = sm;
     fillComboBox();
     fillDevComboBox();
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: koolrik/BugHandler
        //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!");
            }
        }
コード例 #3
0
ファイル: ViewBug.cs プロジェクト: koolrik/BugHandler
 public ViewBug(SessionModule sm)
 {
     InitializeComponent();
     session = sm;
     fillComboBox();
 }
コード例 #4
0
ファイル: InsertBug.cs プロジェクト: koolrik/BugHandler
 //setting parameters
 public InsertBug(SessionModule sm)
 {
     InitializeComponent();
     session = sm;
 }
コード例 #5
0
 public BugSolution(SessionModule sm)
 {
     InitializeComponent();
     session = sm;
     fillComboBox();
 }
コード例 #6
0
 //setting parameters
 public BugHandlerSoftware(SessionModule xyz)
 {
     InitializeComponent();
     session = xyz;
 }
コード例 #7
0
 public BugHandlerAdmin(SessionModule sm)
 {
     InitializeComponent();
 }
コード例 #8
0
 //setting parameters
 public BugHandlerProgrammer(SessionModule sm)
 {
     InitializeComponent();
     session = sm;
 }