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) { 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 btnStart_Click(object sender, EventArgs e) { if (btnStart.Text == "Start") { pnlops.Controls.Clear(); Employee emp = new Employee(); //1-Tabaco Lab //2-Central Office //3-Legazpi //4-Ligao //5-Polangui emp.branch = "2";// LOAD CENTRAL EMPLOYEES //DataTable empdt = emp.SELECT_ALL(); DataTable empdt = emp.SELECT_BY_BRANCH(); if (empdt != null) { label1.Text = "Payroll Generator : FROM :" + cutoff.from_date.ToShortDateString() + " - " + cutoff.to_date.ToShortDateString() + " Total Employee [" + empdt.Rows.Count.ToString() + "]"; foreach (DataRow dr in empdt.Rows) { String empid = dr["empid"].ToString(); emp_payroll_new ep = new emp_payroll_new(); ep.cutoff = cutoff; ep.cutoffdetailsdt = cutoffdetailsdt; ep.empid = empid; ; ep.Dock = DockStyle.Top; ep.Width = pnlops.Width - 40; pnlops.Controls.Add(ep); } } else { MessageBox.Show("EMPLOYEE BY BRANCH NOT WORKING..."); } btnStart.Text = "Print"; } else { frmCutoffAttendanceReport frm = new frmCutoffAttendanceReport(); frm.cutoff_date_from = cutoff.from_date; frm.cutoff_date_to = cutoff.to_date; frm.cutoffdetailsdt = cutoffdetailsdt; frm.ShowDialog(); btnStart.Text = "Start"; } }
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 decimal MINUTELY_RATE = 0;//AKA RATE_PER_MINUTE public Payroll_Generator(Employee empparam, List<Attendance> attendanceparam, List<Cutoff_Details> cutoffparam) { this.emp = empparam; this.attendance = attendanceparam; this.cutoff = cutoffparam; MONTHLY_RATE = emp.GET_BASIC_PAY(); DAILY_RATE = MONTHLY_RATE / 26; string EMP_STATUS = emp.GET_EMPLOYMENT_STATUS(); HOURLY_RATE = (EMP_STATUS == "Regular") ? DAILY_RATE / 7 : DAILY_RATE / 8; }
private void bgw_DoWork(object sender, DoWorkEventArgs e) { Employee emp = new Employee(); DataTable dt = emp.SELECT_IDS(); if (dt != null) { int ctr = dt.Rows.Count; for (int x = 0; x < ctr - 1; x++) { bgw.ReportProgress(x); } } else{ } }
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); } }
public static void CREATE_JECBASCO() { Employee emps = new Employee(); emps.empid = "0039"; emps.fname = "Jose Jericho"; emps.lname = "Basco"; emps.mname = "Astillero"; emps.gender = "Male"; emps.birthdate = DateTime.Now; emps.contactno = "09064418634"; emps.address = "Basud, Tabaco City"; emps.position = "IT-Programmer"; emps.basic_pay = Convert.ToDecimal("10826.00"); emps.date_hired = DateTime.Now; emps.emp_status = "Regular"; emps.branch = "1"; emps.tinno = ""; //if (pbEmpPic.Image != null) //{ // long filesize; // MemoryStream mstream = new MemoryStream(); // pbEmpPic.Image.Save(mstream, System.Drawing.Imaging.ImageFormat.Jpeg); // Byte[] arrImage = mstream.GetBuffer(); // filesize = mstream.Length; // emps.pic = arrImage; //} emps.password = "******"; if (emps.save()) { MessageBox.Show("Okey"); } else { MessageBox.Show("Error :" + db.err.Message); } }
private void btnsave_Click(object sender, EventArgs e) { Employee emp = new Employee(); emp.empid = txtid.Text; emp.fname= txtfname.Text; emp.lname = txtlname.Text; emp.mname = txtmname.Text; emp.gender = cbogender.Text; emp.birthdate = dtBday.Value; emp.contactno = txtcontactno.Text; emp.address = txtaddress.Text; emp.position = cbopositions.Text; emp.basic_pay = Convert.ToDecimal(txtbasicpay.Text); emp.date_hired = dtemploymentdate.Value; emp.emp_status = cboemploymentstatus.Text; string[] branchid = cbobranch.Text.Split('-'); emp.branch = branchid[0]; emp.tinno = txttinno.Text; emp.position = cbopositions.Text; emp.password = "******"; if (pbEmpPic.Image != null){ long filesize; MemoryStream mstream = new MemoryStream(); pbEmpPic.Image.Save(mstream, System.Drawing.Imaging.ImageFormat.Jpeg); Byte[] arrImage = mstream.GetBuffer(); filesize = mstream.Length; emp.pic = arrImage; } if (emp.save()) { MessageBox.Show("Successful", "Saving...", MessageBoxButtons.OK,MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); this.Parent.Height = 0; this.Parent.Controls.Clear(); this.Dispose(); } else{ Logger.WriteErrorLog(db.err.ToString()); MessageBox.Show("Error : " + db.err.ToString() , "Saving...", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
public void LoadAllEployees() { Employee emp= new Employee(); DataTable dt = new DataTable(); dt = emp.SELECT_ALL(); if (dt != null) { int num=1; foreach(DataRow r in dt.Rows){ ListViewItem li = new ListViewItem(); li.Text = num.ToString(); li.SubItems.Add(r["empid"].ToString()); li.SubItems.Add(r["lname"].ToString() + ", " + r["fname"].ToString() + " " + r["mname"].ToString()); li.SubItems.Add(r["position_"].ToString());//r["position"].ToString()); li.SubItems.Add(r["contactno"].ToString()); //li.SubItems.Add(r["gender"].ToString()); li.SubItems.Add(r["address"].ToString()); lv.Items.Add(li); num++; } } }
//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); } }
public void LoadRegularEmployee(ComboBox cbo) { Employee e = new Employee(); DataTable dt = new DataTable(); dt = e.SELECT_REGULAR(); if (dt != null) { foreach (DataRow r in dt.Rows) { cbo.Items.Add(r["lname"] + ", " + r["fname"] + " " + r["mname"] + "-" + r["empid"]); } } }
public void employeeadded(Employee e) { }
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 frmCutoffAttendanceReport_Load(object sender, EventArgs e) { this.rptViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; this.rptViewer.LocalReport.DataSources.Clear(); string path = System.Reflection.Assembly.GetExecutingAssembly().Location.ToString(); var directory = System.IO.Path.GetDirectoryName(path); directory += "\\reports\\atttendance_cutoff.rdlc"; //C:\projects\MMG-PIAPS\MMG-PIAPS\bin\Debug\reports\cutoff_attendance.rdlc //C:\projects\MMG-PIAPS\MMG-PIAPS\bin\Debug\reports\atttendance_cutoff.rdlc this.rptViewer.LocalReport.ReportPath = directory; //MessageBox.Show(directory); Employee emp = new Employee(); emp.branch = "2"; DataTable dt = emp.SELECT_BY_BRANCH(); DataSet1 ds = new DataSet1(); cutoffdt = ds.Tables["cutoffattendance"]; //CREATE AN IMAGE COLUMN //SET THE IMAGE VALUE //THEN ADD TO DATASET FOR REPORT REFERENCE DataColumn colByteArray = new DataColumn("emp_img"); colByteArray.DataType = System.Type.GetType("System.Byte[]"); dt.Columns.Add(colByteArray); foreach (DataRow item in dt.Rows) { Employee e1 = new Employee(); e1.empid = item["empid"].ToString(); item["emp_img"] = e1.GET_IMAGE_BY_ID(); //===================================== //FOR SUBREPORT DATASOURCE //POPULATE THE DATASET, FOR SUBREPORT USAGE //WITH THE EMPLOYEE'S ATTENDANCE FROM BIOMETRICS //THEN CHECKS THE ATTENDANCE WHETHER GOOD (IN,OUT,IN,OUT) //OR INAPPROPRIATE (IN ONLY, OR (IN, OUT, IN), OR (IN,OUT,OUT,IN,OUT) //AND OTHER IMPROPER ATTENDANCE LOGS int x = 1; foreach (DataRow cutoffitem in cutoffdetailsdt.Rows) { DataRow c = cutoffdt.NewRow(); DateTime d = Convert.ToDateTime(cutoffitem["date_"].ToString()); c.BeginEdit(); c["empid"] = e1.empid; c["no"] = x; c["date_"] = d.ToString("MM/dd/yyyy"); //CRREATE A DYNAMIC CONNECTION TO DB non_static_dbcon cn = new non_static_dbcon(); //COMPARE CUTOFF DATE WITH ATTENDANCE HERE //============================================== String attendance; String status; if (cn.CONNECT()) { Attendance att = new Attendance(); att.empid = e1.empid; attendance = att.SELECT_STR_BY_EMPID_BY_DATE(d, cn); String[] attarr= attendance.Split(','); if (attendance != "") { if ((attarr.Length == 3) || (attarr.Length > 4)) { status = "INAPPROPRIATE"; } else if ((attarr.Length == 2) || attarr.Length == 4) { status = "GOOD"; } else { status = "INAPPROPRIATE"; } } else { status = ""; } } else { attendance = ""; status = ""; } cn.DISCONNECT(); c["attendance_"] = attendance; //=============================================== c["day_type"] = cutoffitem["day_type"].ToString(); c["status_"] = status; cutoffdt.Rows.Add(c); x++; } //===================================== }//end foreach item in dt.rows ReportDataSource r = new ReportDataSource("DataSet1", dt); this.rptViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(localReport_SubreportProcessing); //SET REPORT PARAMETER ReportParameter from_date = new ReportParameter("cutoff_date_from", cutoff_date_from.ToString("MM/dd/yyyy")); ReportParameter to_date = new ReportParameter("cutoff_date_to", cutoff_date_to.ToString("MM/dd/yyyy")); rptViewer.LocalReport.SetParameters(from_date); rptViewer.LocalReport.SetParameters(to_date); this.rptViewer.LocalReport.DataSources.Add(r); // this.rptViewer.SetDisplayMode(DisplayMode.PrintLayout); this.rptViewer.RefreshReport(); }
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; } } }
public Employee SELECT_BY_IDPASS() { DataTable dt = new DataTable(); MySqlCommand cmd = new MySqlCommand(); db.SET_COMMAND_PARAMS(cmd, "EMP_SELECT_BY_IDPASS"); cmd.Parameters.AddWithValue("_empid", empid); cmd.Parameters.AddWithValue("_pword", password); MySqlDataAdapter da = new MySqlDataAdapter(cmd); da.Fill(dt); if (dt != null) { if (dt.Rows.Count > 0) { Employee e = new Employee(); foreach (DataRow r in dt.Rows) { e.empid = r["empid"].ToString(); e.fname = r["fname"].ToString(); e.lname = r["lname"].ToString(); e.mname = r["mname"].ToString(); e.address = r["address"].ToString(); e.birthdate = Convert.ToDateTime(r["birthday"].ToString()); e.contactno = r["contactno"].ToString(); e.gender = r["gender"].ToString(); e.COOP_MEMBERSHIP_ID = r["COOP_MEMBERSHIP_ID"].ToString(); e.tinno = r["tinno"].ToString(); e.password = r["pword"].ToString(); } return e; } else { return null; } } else { return null; } }
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(); } }
private void attendance_ctrl_Load(object sender, EventArgs e) { Employee emp = new Employee(); emp.LoadEmployee(cboEmp); Attendance a = new Attendance(); a.LoadInListView(lv); chkDate.Checked = true; chkEmp.Checked = true; }
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(); }