private void emp_restriction_current_user_Load(object sender, EventArgs e) { Emp_Restriction er, er2 = new Emp_Restriction(); er2.empid = Global.CURRENT_USER.empid; er = er2.SELECT_BY_ID(); //LOOP THROUGH ALL RESTRICTIONS THEN ADD A CHECKBOX FOR EACH RESTRICTION GenereateCheckBoxes(er); }
private void tztpassword_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode.ToString().Equals("Return")) { Employee emp, emp1 = new Employee(); emp1.empid = txtid.Text; String hash; using (MD5 md5Hash = MD5.Create()) { hash = Global.GetMd5Hash(md5Hash, txtpassword.Text); } emp1.password = hash; emp = emp1.SELECT_BY_IDPASS(); //MessageBox.Show(hash); if (emp != null) { Global.CURRENT_USER.empid = emp.empid; Global.CURRENT_USER = emp; Global.CURRENT_USER.pic = emp.GET_IMAGE_BY_ID(); Global.CURRENT_USER.basic_pay = emp.GET_BASIC_PAY(); Global.CURRENT_USER.emp_status = emp.GET_EMPLOYMENT_STATUS(); Global.CURRENT_USER.position = emp.GET_CURRENT_POSITION(); Global.CURRENT_USER.branch = emp.GET_BRANCH_ASSIGNMENT(); //CREATE A RESTRICTION OBJECT Emp_Restriction r = new Emp_Restriction(); //SET CURRENT USER RESTRICTION r.empid = Global.CURRENT_USER.empid; Global.CURRENT_USER.restriction = r.SELECT_BY_ID(); Global.CURRENT_USER.LIST_BENEFITS(); //GET CURRENT USER LATEST SCHEDULE Emp_Sched es = new Emp_Sched(); es.empid = Global.CURRENT_USER.empid; Global.CURRENT_USER.schedule = es.SELECT_BY_EMPID(); Global.CURRENT_USER.ISLOGGEDIN = true; frmMain f = new frmMain(); f.Show(); this.Hide(); } else { MessageBox.Show("Nothing found"); } } }
private void cboEmp_SelectedIndexChanged(object sender, EventArgs e) { pnlrestrictions.Controls.Clear(); if (cboEmp.Text != "") { String[] c = cboEmp.Text.ToString().Split('-'); String id = c[1]; Employee emp1, emp2 = new Employee(); emp2.empid = id; emp1 = emp2.SELECT_BY_ID(); emp = emp1; //emp1.SELECT_BY_ID(); emp1.GET_IMAGE_BY_ID(); String pos = (emp1.GET_CURRENT_POSITION() != "") ? emp1.position.ToString() : "NO_POSITION_INDICATED"; lblemp.Text = emp1.lname.ToUpper() + ", " + emp1.fname.ToUpper() + " " + emp1.mname.ToUpper() + " - " + pos; if (emp1.pic != null) { MemoryStream ms = new MemoryStream(emp1.pic); pb.Image = Image.FromStream(ms); pb.SizeMode = PictureBoxSizeMode.Zoom; } else { pb.Image = Properties.Resources.noimagefound; pb.SizeMode = PictureBoxSizeMode.Zoom; } //GET THE RESTRICTIONS Emp_Restriction er, er2 = new Emp_Restriction(); er2.empid = emp.empid; er = er2.SELECT_BY_ID(); //LOOP THROUGH ALL RESTRICTIONS THEN ADD A CHECKBOX FOR EACH RESTRICTION GenereateCheckBoxes(er); } }