private void cmdViewPayroll_Click(object sender, EventArgs e) { //Make sure that a date was selected if (!UtilityDates.isDate(txtTransDate.Text)) { MessageBox.Show("The transaction date does not appear to be a valid date"); return; } loadPendingPayroll(); }
private void cmdRunByFund_Click(object sender, EventArgs e) { if (UtilityDates.isDate(txtTransDate.Text)) { frmTransactionsPayrollByApptType frmPayByFund = new frmTransactionsPayrollByApptType(txtTransDate.Text, lstPayrollGroup.SelectedValue.ToString(), this); //frmPayByFund.MdiParent = frmSwitchboard.frmParent; frmPayByFund.Show(); } else { MessageBox.Show("You must first select a target month for payroll processing."); } }
private void cmdRunTransactions_Click(object sender, EventArgs e) { //Make sure that a date was selected if (!UtilityDates.isDate(txtTransDate.Text)) { MessageBox.Show("The transaction date does not appear to be a valid date"); return; } this.Cursor = Cursors.WaitCursor; addEmpToVendors(); checkBeforeRun(); //loadLstErrors(); this.Cursor = Cursors.Default; }
//Methods //fill dbcPayroll private void fillDBCPayroll() { lblPendingPayrollCount.Text = " "; if (!UtilityDates.isDate(txtTransDate.Text)) { MessageBox.Show("The transaction date does not appear to be a valid date"); return; } String sql = @" SELECT Employees.EmpNameFirst, Employees.EmpNameLast, Employees.EmpID, Employees.UnitID, Employees.EmpUIN, refAppointmentType.EmpAppTypeDesc, Employees_Appointments.EmpAppointPrimaryFund, Employees_Appointments.EmpAppointSalary, Employees_Appointments.EmpAppointTimeBase, Employees_Appointments.EmpAppointFTCompRate, Employees_Appointments.JobCodeID, CONVERT(nvarchar(10), Employees_Appointments.EmpAppointDateBegin, 101) AS EtracDateStart, CONVERT(nvarchar(10), Employees_Appointments.EmpAppointDateEnd, 101) AS EtracDateEnd, CONVERT(nvarchar(10), Employees_Appointments.EmpAppointPayrollDateStart, 101) AS PayrollDateStart, CONVERT(nvarchar(10), Employees_Appointments.EmpAppointPayrollDateEnd,101) AS PayrollDateEnd, Employees_Appointments.EmpAppointEtrac, Employees_Appointments.EmpAppointPositionNum, Employees_Appointments.EmpAppointID, Employees_JobCodes.JobCodeGLID, Employees_Appointments.TransFundID, Employees.EmpTypeID, refEmployeeType.EmpTypeDesc, Transactions_Funding.DeptID, Transactions_Funding.FundType, Transactions_Funding.FundProject + Transactions_Funding.FundClass AS FundProjClass, Transactions_GLs.GLNumber FROM Employees_Appointments INNER JOIN Employees ON Employees_Appointments.EmpID = Employees.EmpID INNER JOIN Employees_JobCodes ON Employees_Appointments.JobCodeID = Employees_JobCodes.JobCodeID INNER JOIN refAppointmentType ON Employees_Appointments.EmpAppTypeID = refAppointmentType.EmpAppTypeID INNER JOIN refEmployeeType ON Employees.EmpTypeID = refEmployeeType.EmpTypeID INNER JOIN Transactions_Funding ON Employees_Appointments.TransFundID = Transactions_Funding.TransFundID INNER JOIN Transactions_GLs ON Employees_JobCodes.JobCodeGLID = Transactions_GLs.GLID WHERE (Employees_Appointments.EmpAppointPayrollDateStart <= CONVERT(DATETIME, '" + txtTransDate.Text + @"', 102)) AND (Employees_Appointments.EmpAppointPayrollDateEnd >= CONVERT(DATETIME, '" + txtTransDate.Text + @"', 102)) AND Employees_JobCodes.JobCodeHourly = 1 AND Employees.UnitID <> 'OTHER' AND Employees_Appointments.EmpAppTypeID <> 6 AND Employees_JobCodes.JobCodeGL <> '000000' AND EmpAppointSalary > 0 AND Employees.EmpTypeID = " + payrollGroup; //Console.WriteLine("\n[283]\n [{0}]", sql); if (lstUnitPayroll.SelectedItems.Count > 0) //Harry 20151029 // if (isUnitSelected()) { sql += " AND Employees.UnitID = '" + lstUnitPayroll.SelectedItems[0].Name + "'"; } if (lstFundPayroll.SelectedItems.Count > 0) //Harry 20151029 // if (isFundSelected()) { //If fund is provided from form, append to query to filter for specified unit sql += " AND Employees_Appointments.TransFundID = " + lstFundPayroll.SelectedItems[0].Name.ToString() + " "; } if (lstGLPayroll.SelectedItems.Count > 0) //Harry 20151029 // if (isGLSelected()) { //If fund is provided from form, append to query to filter for specified unit sql += " AND Transactions_GLs.GLID = " + lstGLPayroll.SelectedItems[0].Name.ToString() + " "; } //add order to sql sql += " ORDER BY Employees_JobCodes.JobCodeGL,Employees.EmpNameLast"; dbcPayroll = new DBConnector(sql, "Appointments"); }