private void cboEmp_SelectedIndexChanged(object sender, EventArgs e) { 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; } } }
private void attendanceToolStripMenuItem_Click(object sender, EventArgs e) { if (lv.SelectedItems.Count > 0) { String id = lv.SelectedItems[0].SubItems[1].Text; Employee emp, emp1 = new Employee(); emp1.empid = id; emp = emp1.SELECT_BY_ID(); emp.GET_BASIC_PAY(); emp.GET_BRANCH_ASSIGNMENT(); emp.GET_EMPLOYMENT_STATUS(); emp.GET_IMAGE_BY_ID(); emp.GET_CURRENT_POSITION(); pnlops.Controls.Clear(); attendance_entry c = new attendance_entry(); c.emp = emp; c.Width = pnlops.Width; pnlops.Height = c.Height; pnlops.Controls.Add(c); } }
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); } }
private void attendanceToolStripMenuItem_Click(object sender, EventArgs e) { if (lv.SelectedItems.Count > 0) { String id = lv.SelectedItems[0].Tag.ToString(); DateTime dtime = Convert.ToDateTime(lv.SelectedItems[0].SubItems[3].Text); Employee emp, emp1 = new Employee(); emp1.empid = id; emp = emp1.SELECT_BY_ID(); emp.GET_CURRENT_POSITION(); emp.GET_IMAGE_BY_ID(); pnlops.Controls.Clear(); frmAttendance_Fixer c = new frmAttendance_Fixer(); c.emp = emp; c.thisdate = dtime; c.ShowDialog(); } }
//BGW asynchronously GET EMPLOYEE DETAILS //ASYNC GET IMAGE FROM DATABASE //ASYNC GET LASTEST POSITION private void bgw_DoWork(object sender, DoWorkEventArgs e) { Employee getter = new Employee(); getter.empid = empid; if (dbcon.CONNECT()) { emp=getter.SELECT_BY_ID(dbcon); emp.GET_IMAGE_BY_ID(dbcon); emp.GET_CURRENT_POSITION(dbcon); Emp_Sched es = new Emp_Sched(); es.empid = emp.empid; empsched = es.SELECT_BY_EMPID(dbcon); } }
private void cboemp_SelectedIndexChanged(object sender, EventArgs e) { txtinterest.Text = ""; txtinterest_amort.Text = ""; cboprincipal.Text = ""; txtprincipal_amort.Text = ""; txttotal_amort.Text = ""; MAXIMUM_ALLOWED_AMORT_PERIOD = 0; MAXIMUM_ALLOWED_LOAN = 0; txtbalance.Text = ""; cbopayment_mode.Text = ""; cbocollection_day.Text = ""; cboamortization_period.Text = ""; txtnetproceeds.Text = ""; lbapplicantsdata.Items.Clear(); lblatestloan.Items.Clear(); lbcomakersdata.Items.Clear(); lbcomakerslatestloan.Items.Clear(); if (cboemp.Text != "") { String[] c = cboemp.Text.ToString().Split('-'); String id = c[1]; Employee emp2 = new Employee(); emp2.empid = id; applicant = emp2.SELECT_BY_ID(); //GET LATEST BASIC SAL decimal BASIC_PAY = applicant.GET_BASIC_PAY(); //emp1.SELECT_BY_ID(); applicant.GET_IMAGE_BY_ID(); String pos = (applicant.GET_CURRENT_POSITION() != "") ? applicant.position.ToString() : "NO_POSITION_INDICATED"; lblemp.Text = applicant.lname.ToUpper() + ", " + applicant.fname.ToUpper() + " " + applicant.mname.ToUpper() + " - " + pos; //WHEN WAS THE EMPLOYEE BECAME REGULAR? DateTime regularization_date = applicant.GET_REGULAR_STATUS_DATE(); int months_as_regular = Global.GetMonths(regularization_date, DateTime.Now); //DISPLAY REGULARIZATION DATE lbapplicantsdata.Items.Add("EMPLOYEE INFORMATION"); lbapplicantsdata.Items.Add("BECAME REGULAR SINCE :" + regularization_date.ToShortDateString()); lbapplicantsdata.Items.Add("TOTAL MONTHS_IN_SEVICE AS REGULAR : " + months_as_regular.ToString()); lbapplicantsdata.Items.Add("BASIC SALARY : " + BASIC_PAY.ToString("#,##0.00")); //DETERMINE HOW MUCH LOAN IS ALLOWED FOR THIS CERTAIN EMPLOYEE //ACCORDING TO HIS/HER BASIC PAY //MessageBox.Show(months_as_regular + " - " + BASIC_PAY.ToString()); if ((months_as_regular >= 6) && (months_as_regular <= 12)) { MAXIMUM_ALLOWED_LOAN = 2 * BASIC_PAY; MAXIMUM_ALLOWED_AMORT_PERIOD = 6; iteratesalary(BASIC_PAY, cboprincipal, 2); } else if ((months_as_regular > 12) && (months_as_regular <= 24)) { MAXIMUM_ALLOWED_LOAN = 4 * BASIC_PAY; MAXIMUM_ALLOWED_AMORT_PERIOD = 24; iteratesalary(BASIC_PAY, cboprincipal, 4); } else if (months_as_regular > 24) { MAXIMUM_ALLOWED_LOAN = 6 * BASIC_PAY; MAXIMUM_ALLOWED_AMORT_PERIOD = 24; iteratesalary(BASIC_PAY, cboprincipal, 6); } //display latest loan l.empid = applicant.empid; Loan applicant_latest_loan = l.GET_LATEST_LOAN("SALARY"); PREV_LOAN = applicant_latest_loan; // GET THE LATEST MICRO LOAN OF A MEMBER lblatestloan.Items.Add("LATEST MICRO LOAN"); LATEST_SALARY_LOAN = (applicant_latest_loan != null) ? applicant_latest_loan.principal : 0; if (LATEST_SALARY_LOAN != 0) { lblatestloan.Items.Add("APPLICATION NO : " + applicant_latest_loan.application_no); lblatestloan.Items.Add("PRINCIPAL : PhP " + applicant_latest_loan.principal.ToString("#,##0.00")); lblatestloan.Items.Add("INTEREST : PhP " + applicant_latest_loan.interest.ToString("#,##0.00")); lblatestloan.Items.Add("MONTHLY AMORTIZATION: PhP " + (applicant_latest_loan.amortization_on_interest + applicant_latest_loan.amortization_on_principal).ToString("#,##0.00")); lblatestloan.Items.Add("BALANCE: ---(under development)---"); } else { lblatestloan.Items.Add("Nothing found..."); lblatestloan.Items.Add("MAXIMUM ALLOWED LOAN :" + MAXIMUM_ALLOWED_LOAN.ToString("#,##0.00")); lblatestloan.Items.Add("MAXIMUM AMORTIZATION PERIOD :" + MAXIMUM_ALLOWED_AMORT_PERIOD.ToString()); } cboprincipal.Text = MAXIMUM_ALLOWED_LOAN.ToString("0.00"); // lblloancategory.Text = "MAXIMUM_ALLOWED_AMOUNT : " + MAXIMUM_ALLOWED_LOAN.ToString("#,##0.00") + " MAXIMUM_AMORTIZATION_PERIOD : " + MAXIMUM_ALLOWED_AMORT_PERIOD.ToString(); //nmamortperiod.Maximum = MAXIMUM_ALLOWED_AMORT_PERIOD; //nmamortperiod.Value = nmamortperiod.Maximum; if (applicant.pic != null) { MemoryStream ms = new MemoryStream(applicant.pic); pb.Image = Image.FromStream(ms); pb.SizeMode = PictureBoxSizeMode.Zoom; } else { pb.Image = Properties.Resources.noimagefound; pb.SizeMode = PictureBoxSizeMode.Zoom; } } }
private void cboComaker_SelectedIndexChanged(object sender, EventArgs e) { lbcomakersdata.Items.Clear(); lbcomakerslatestloan.Items.Clear(); if (cboComaker.Text != "") { String[] c = cboComaker.Text.ToString().Split('-'); String id = c[1]; Employee emp2 = new Employee(); emp2.empid = id; comaker = emp2.SELECT_BY_ID(); //GET LATEST BASIC SAL decimal BASIC_PAY = comaker.GET_BASIC_PAY(); //emp1.SELECT_BY_ID(); comaker.GET_IMAGE_BY_ID(); String pos = (comaker.GET_CURRENT_POSITION() != "") ? comaker.position.ToString() : "NO_POSITION_INDICATED"; lblcomaker.Text = comaker.lname.ToUpper() + ", " + comaker.fname.ToUpper() + " " + comaker.mname.ToUpper() + " - " + pos; //WHEN WAS THE EMPLOYEE BECAME REGULAR? DateTime regularization_date = comaker.GET_REGULAR_STATUS_DATE(); int months_as_regular = Global.GetMonths(regularization_date, DateTime.Now); //DISPLAY REGULARIZATION DATE lbcomakersdata.Items.Add("EMPLOYEE INFORMATION"); lbcomakersdata.Items.Add("BECAME REGULAR SINCE :" + regularization_date.ToShortDateString()); lbcomakersdata.Items.Add("TOTAL MONTHS_IN_SEVICE AS REGULAR : " + months_as_regular.ToString()); lbcomakersdata.Items.Add("BASIC SALARY : " + BASIC_PAY.ToString("#,##0.00")); //display latest loan l.empid = comaker.empid; Loan comakers_latest_loan = l.GET_LATEST_LOAN("SALARY"); // GET THE LATEST MICRO LOAN OF A MEMBER lbcomakerslatestloan.Items.Add("LATEST MICRO LOAN"); COMAKERS_LATEST_SALARY_LOAN = (comakers_latest_loan != null) ? comakers_latest_loan.principal : 0; if (COMAKERS_LATEST_SALARY_LOAN != 0) { lbcomakerslatestloan.Items.Add("APPLICATION NO : " + comakers_latest_loan.application_no); lbcomakerslatestloan.Items.Add("PRINCIPAL : PhP " + comakers_latest_loan.principal.ToString("#,##0.00")); lbcomakerslatestloan.Items.Add("INTEREST : PhP " + comakers_latest_loan.interest.ToString("#,##0.00")); lbcomakerslatestloan.Items.Add("MONTHLY AMORTIZATION: PhP " + (comakers_latest_loan.amortization_on_interest + comakers_latest_loan.amortization_on_principal).ToString("#,##0.00")); lbcomakerslatestloan.Items.Add("BALANCE: ---(under development)---"); } else { lbcomakerslatestloan.Items.Add("Nothing found..."); } //CHECK IF THIS COMAKER HAS BEEN A COMAKER FOR MORE THAN ONE(1) MEMBER_EMPLOYEE //========================================================================== //-------> INSERT CODE HERE lbcomakerslatestloan.Items.Add("CURRENTLY COMAKER TO : ...{under development}..."); //=========================================================================== // LOAD EMPLOYEE PICTURE if (comaker.pic != null) { MemoryStream ms = new MemoryStream(comaker.pic); pbcomaker.Image = Image.FromStream(ms); pbcomaker.SizeMode = PictureBoxSizeMode.Zoom; } else { pbcomaker.Image = Properties.Resources.noimagefound; pbcomaker.SizeMode = PictureBoxSizeMode.Zoom; } } }
private void viewScheduleToolStripMenuItem_Click(object sender, EventArgs e) { String id = lv.SelectedItems[0].SubItems[1].Text; //MessageBox.Show(id); Employee emp, emp1 = new Employee(); emp1.empid = id; emp = emp1.SELECT_BY_ID(); emp.GET_BASIC_PAY(); emp.GET_BRANCH_ASSIGNMENT(); emp.GET_EMPLOYMENT_STATUS(); emp.GET_IMAGE_BY_ID(); emp.GET_CURRENT_POSITION(); emp.LIST_BENEFITS(); pnlops.Controls.Clear(); Emp_Sched es = new Emp_Sched(); es.empid = emp.empid; emp.schedule= es.SELECT_BY_EMPID(); emp_view_sched c = new emp_view_sched(); c.emp = emp; c.Width = pnlops.Width; pnlops.Height = c.Height; pnlops.Controls.Add(c); }
private void updateBasicSalaryToolStripMenuItem_Click(object sender, EventArgs e) { String id = lv.SelectedItems[0].SubItems[1].Text; Employee emp, emp1 = new Employee(); emp1.empid = id; emp = emp1.SELECT_BY_ID(); emp.GET_BASIC_PAY(); //emp.GET_BRANCH_ASSIGNMENT(); //emp.GET_EMPLOYMENT_STATUS(); emp.GET_IMAGE_BY_ID(); emp.GET_CURRENT_POSITION(); pnlops.Controls.Clear(); }