private void Admin_M_Panel_Load(object sender, EventArgs e) { time.Text = DateTime.Now.ToLongTimeString(); date.Text = DateTime.Now.ToLongDateString(); string query = "select * from tbl_project_complete"; Connectiondb conn = new Connectiondb(); DataTable bugDt = conn.retrieve(query); completed.DataSource = bugDt; string pendings = "select * from tbl_project"; DataTable test = conn.retrieve(pendings); pending.DataSource = test; }
private void btn_sendtodeveloper_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtcode.Text) || String.IsNullOrEmpty(txt_lineno.Text)) { MessageBox.Show("Any of the field cannot be empty", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Connectiondb conn = new Connectiondb(); string query = "select project_id from tbl_developer where project_id='" + Tester_Panel.project_Id + "'"; DataTable dt = conn.retrieve(query); //checking wether rows/data are selected or not if (dt.Rows.Count > 0) { MessageBox.Show("Project has already been sent to Developer", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { string insquery = "insert into tbl_developer values('" + Tester_Panel.project_Id + "','" + Tester_Panel.project_name + "','" + Tester_Panel.project_date + "','" + Tester_Panel.project_complete + "','" + txtcode.Text + "','" + txt_lineno.Text + "','" + txt_status1.Text + "')"; conn.manipulate(insquery); MessageBox.Show("Successfully sent to Developer!!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); string upquery = "update tbl_project set status = 'Send to Developer' where project_id = '" + Tester_Panel.project_Id + "'"; conn.manipulate(upquery); this.Close(); } } }
private void btn_refresh_Click(object sender, EventArgs e) { string query = "select * from tbl_project_complete"; Connectiondb conn = new Connectiondb(); DataTable bugDt = conn.retrieve(query); completed.DataSource = bugDt; }
private void btn_refresh1_Click(object sender, EventArgs e) { string pendings = "select * from tbl_project"; Connectiondb conn = new Connectiondb(); DataTable test = conn.retrieve(pendings); pending.DataSource = test; }
private void button1_Click(object sender, EventArgs e) { string firstname, lastname, username, password, email, usertype; firstname = txt_fname.Text; lastname = txt_lname.Text; username = txt_uname.Text; password = txt_pw.Text; email = txt_mail.Text; usertype = cmb_type.Text; if (String.IsNullOrEmpty(firstname)) { MessageBox.Show("First name cannot be empty!!.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_fname.Focus(); } else if (String.IsNullOrEmpty(lastname)) { MessageBox.Show("Last name cannot be empty!!.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_lname.Focus(); } else if (String.IsNullOrEmpty(username)) { MessageBox.Show("Username cannot be empty!!.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_uname.Focus(); } else if (String.IsNullOrEmpty(password)) { MessageBox.Show("Password cannot be empty!!.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_pw.Focus(); } else if (String.IsNullOrEmpty(password)) { MessageBox.Show("Usertype cannot be empty!!.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); cmb_type.Focus(); } else { string temp; temp = txt_uname.Text; query = query = "select Username from [Signupdata] where Username='******'"; DataTable dt = conn.retrieve(query); //checking wether rows/data are selected or not if (dt.Rows.Count > 0) { MessageBox.Show(temp + " cannot be used. Because it is already used", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_uname.Clear(); txt_pw.Clear(); } else { //try catch to confirm the value is inserted try { query = "insert into Signupdata(First_name,Last_name,Username,Password,Email,Usertype) values('" + firstname + "','" + lastname + "','" + username + "','" + password + "','" + email + "','" + usertype + "')"; conn.manipulate(query); MessageBox.Show("Registration Successfull!!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); Form1 login_form = new Form1(); login_form.Show(); this.Hide(); } catch { MessageBox.Show("Data Cannot be inserted due to the internal application problem!! ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }
private void Login_Click(object sender, EventArgs e) { string username, password, query; username = txt_uname.Text; password = txt_pw.Text;; // query for selecting user from database if (String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password)) { MessageBox.Show("Please Enter Username and Password.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_uname.Focus(); } else { //for checking if the respetive username exists for not query = "select Username from Signupdata where Username='******'"; DataTable dt = conn.retrieve(query); if (dt.Rows.Count > 0) { query = "select Usertype, Username, Password from Signupdata where Username='******' and Password='******'"; DataTable dts = conn.retrieve(query); if (dts.Rows.Count > 0) { query = "select Usertype from Signupdata where Username = '******'"; DataTable typ = conn.retrieve(query); if (dts.Rows.Count > 0) { //retrive and store user type in string type string type; type = typ.Rows[0][0].ToString(); if (type == "Developer") { username = txt_uname.Text.Trim(); Developer_Panel panel = new Developer_Panel(); panel.Show(); this.Hide(); } else if (type == "Tester") { username = txt_uname.Text; Tester_Panel panel = new Tester_Panel(); panel.Show(); this.Hide(); } else if (type == "Admin") { username = txt_uname.Text; //Admin_Panel panel = new Admin_Panel(); //panel.Show(); Admin_M_Panel panel = new Admin_M_Panel(); panel.Show(); this.Hide(); } } else { //system error no usertype error throw later MessageBox.Show("Error from the system"); } } else { MessageBox.Show("Username or Password is incorrect", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_pw.Clear(); } } else { MessageBox.Show("No such username exist", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_uname.Clear(); txt_pw.Clear(); } } }