private ReportViewer LoadReport_vMLeaveBalanceWithSR(List <VMLeaveBalance> list, ReportViewer rv) { rv.LocalReport.ReportPath = Server.MapPath(ReportPath); IEnumerable <VMLeaveBalance> ie; ie = list.AsQueryable(); ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie); rv.LocalReport.DataSources.Add(datasource1); ReportParameter rp = new ReportParameter("Date", DateTitle, false); ReportParameter rp1 = new ReportParameter("Header", CompanyHeader + ReportTitle, false); ReportParameter rp2 = new ReportParameter("Footer", ReportFooter, false); rv.LocalReport.SetParameters(new ReportParameter[] { rp, rp1, rp2 }); rv.LocalReport.SubreportProcessing += (object sender, SubreportProcessingEventArgs e) => { string EmpNo = e.Parameters["EmployeeID"].Values.First().ToString(); VMSelectedFilter vmf = Session["FiltersModel"] as VMSelectedFilter; int FinancialYearID = ATAssistant.GetFinancialYearID((DateTime)vmf.DateTo, DDService.GetFinancialYear()); FinancialYear dbFinancialYear = DDService.GetFinancialYear().Where(aa => aa.PFinancialYearID == FinancialYearID).First(); DataTable dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_LeaveData where OEmpID='" + EmpNo + "' and (AttDate >= " + "'" + dbFinancialYear.FYStartDate.Value.ToString("yyyy-MM-ddd") + "'" + " and AttDate <= " + "'" + dbFinancialYear.FYEndDate.Value.ToString("yyyy-MM-ddd") + "'" + " )"); List <VAT_LeaveData> VATLeaveData = dataTable.ToList <VAT_LeaveData>(); e.DataSources.Add(new ReportDataSource("DataSet1", VATLeaveData)); }; rv.LocalReport.Refresh(); return(rv); }
public void SetSubDataSource(object sender, SubreportProcessingEventArgs e) { string EmpNo = e.Parameters["EmployeeID"].Values.First().ToString(); VMSelectedFilter vmf = Session["FiltersModel"] as VMSelectedFilter; int FinancialYearID = ATAssistant.GetFinancialYearID((DateTime)vmf.DateTo, DDService.GetFinancialYear()); FinancialYear dbFinancialYear = DDService.GetFinancialYear().Where(aa => aa.PFinancialYearID == FinancialYearID).First(); DataTable dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_LeaveData where OEmpID='" + EmpNo + "' and (AttDate >= " + "'" + dbFinancialYear.FYStartDate.Value.ToString("yyyy-MM-ddd") + "'" + " and AttDate <= " + "'" + dbFinancialYear.FYEndDate.Value.ToString("yyyy-MM-ddd") + "'" + " )"); List <VAT_LeaveData> VATLeaveData = dataTable.ToList <VAT_LeaveData>(); e.DataSources.Add(new ReportDataSource("DataSet1", VATLeaveData)); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { VMSelectedFilter vmf = Session["FiltersModel"] as VMSelectedFilter; VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; DataTable dataTable = new DataTable(); ReportPath = "~/Areas/Reporting/RDLC/Attendance/"; string DateFromS = vmf.DateFrom.Value.ToString("dd-MMM-yyyy"); string DateToS = vmf.DateTo.Value.ToString("dd-MMM-yyyy"); string query = QueryBuilder.GetReportQueryForLoggedUser(LoggedInUser, db.VHR_EmployeeProfile.ToList()); if (query != "") { query = " and " + query; } int FinancialYearID = ATAssistant.GetFinancialYearID((DateTime)vmf.DateTo, db.FinancialYears.OrderByDescending(aa => aa.PFinancialYearID).ToList()); String reportName = Request.QueryString["reportname"]; switch (reportName) { case "leaveBalanceEmp_report": ///YEARLY LEAVE BALANCE REPORT List <VHR_EmployeeProfile> dbEmps = ReportAssistant.GetEmployeeInfo(LoggedInUser, db.VHR_EmployeeProfile.ToList()); List <VHR_EmployeeProfile> dbTempEmps = new List <VHR_EmployeeProfile>(); dbEmps = AttendanceFilter.ReportsFilterImplementation(vmf, dbTempEmps, dbEmps); List <LeavePolicy> dbLeavePolicies = db.LeavePolicies.ToList(); ReportTitle = "Yearly Leave Ledger Report"; ReportPath = ReportPath + "YEmpProRataBalance.rdlc"; FinancialYear dbFinancialYear = db.FinancialYears.Where(aa => aa.PFinancialYearID == FinancialYearID).First(); DateTitle = dbFinancialYear.FYStartDate.Value.ToString("dd-MM-yyyy") + " TO " + dbFinancialYear.FYEndDate.Value.ToString("dd-MM-yyyy"); List <LeaveQuotaYear> dbLeaveQuotaYear = db.LeaveQuotaYears.Where(aa => aa.FinancialYearID == dbFinancialYear.PFinancialYearID).ToList(); List <LeaveData> dbLeaveDatas = db.LeaveDatas.Where(aa => aa.AttDate >= dbFinancialYear.FYStartDate && aa.AttDate <= dbFinancialYear.FYEndDate && aa.LeaveTypeID == 5).ToList(); DateTitle = "Leave Balance Statement from Year: " + dbFinancialYear.FYName; ReportFooter = "System Generated Report by: " + LoggedInUser.UserName + " at " + DateTime.Now.ToString("hh:mm tt"); reportViewer = LoadReport_vMLeaveBalanceWithSR(ReportAssistant.GetYearlyLeaveBalance(dbEmps, dbFinancialYear, dbLeaveQuotaYear, dbLeavePolicies, dbLeaveDatas, db), reportViewer); break; } } }
// GET: Reporting/AttendanceContainer public ActionResult Index() { String reportName = Request.QueryString["reportName"]; VMSelectedFilter vmf = Session["FiltersModel"] as VMSelectedFilter; VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; DataTable dataTable = new DataTable(); ReportPath = "~/Areas/Reporting/RDLC/Attendance/"; PerformanceReportPath = "~/Areas/Reporting/RDLC/Performance/"; string DateFromS = vmf.DateFrom.Value.ToString("dd-MMM-yyyy"); string DateToS = vmf.DateTo.Value.ToString("dd-MMM-yyyy"); string query = QueryBuilder.GetReportQueryForLoggedUser(LoggedInUser, DDService.GetEmployeeInfo()); if (query != "") { query = " and " + query; } DateTitle = DateFromS + " TO " + DateToS; if (vmf.SelectedCompany.Count() == 1) { if (vmf.SelectedCompany.First().FilterID == 1) { CompanyHeader = "BCL - "; } else if (vmf.SelectedCompany.First().FilterID == 2) { CompanyHeader = "A1 - "; } else { CompanyHeader = "Other - "; } } if (vmf.SelectedCompany.Count() == 0 || vmf.SelectedCompany == null) { CompanyHeader = ""; } // Initilize Report ReportViewer reportViewer = new ReportViewer() { ProcessingMode = ProcessingMode.Local, SizeToReportContent = true, Width = Unit.Pixel(1200), Height = Unit.Pixel(1300) }; int PayrollPeriodIDStart = ATAssistant.GetPayrollPeriodIDStart((DateTime)vmf.DateFrom, DDService.GetAllPayrollPeriod()); int PayrollPeriodIDEnd = ATAssistant.GetPayrollPeriodIDEnd((DateTime)vmf.DateTo, DDService.GetAllPayrollPeriod()); int FinancialYearID = ATAssistant.GetFinancialYearID((DateTime)vmf.DateTo, DDService.GetFinancialYear()); reportViewer.ProcessingMode = ProcessingMode.Local; reportViewer.LocalReport.DisplayName = CompanyHeader + ReportTitle; System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted); reportViewer.LocalReport.SetBasePermissionsForSandboxAppDomain(sec); reportViewer.LocalReport.DataSources.Clear(); reportViewer.LocalReport.EnableExternalImages = true; ReportFooter = "System Generated Report by: " + LoggedInUser.UserName + " at " + DateTime.Now.ToString("hh:mm tt"); switch (reportName) { #region ------Monthly Attendance Reports------- case "detailed_att": //EMPLOYEE DETAILED ATTENDANCE REPORT CAN BE GENERATED DAILY dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " ) " + query); List <VAT_DailyAttendance> VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); List <VAT_DailyAttendance> TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Employee Detailed Attendence Report"; ReportPath = ReportPath + "EmpAttSummary.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "monthly_attendance": //MONTHLY ATTENDANCE SUMMARY REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_MonthlySummary where (PayrollPeriodID >=" + PayrollPeriodIDStart + " and PayrollPeriodID <=" + PayrollPeriodIDEnd + " )" + query); List <VAT_MonthlySummary> VATMonthlySummary = dataTable.ToList <VAT_MonthlySummary>(); List <VAT_MonthlySummary> TMP_VATMonthlySummary = new List <VAT_MonthlySummary>(); ReportTitle = "Employee Monthly Attendance Report"; ReportPath = ReportPath + "MRSummary.rdlc"; reportViewer = LoadReport_VATMonthlySummary(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATMonthlySummary, VATMonthlySummary), reportViewer); break; case "overtime_summaryreport": ///MONTHLY OVERTIME SUMMARY REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_MonthlySummary where ((EncashbaleSingleOT>0 or EncashbaleDoubleOT>0 or CPLConversionOT>0) and PayrollPeriodID=" + PayrollPeriodIDStart + " )" + query); List <VAT_MonthlySummary> VATMonthlySummary1 = dataTable.ToList <VAT_MonthlySummary>(); List <VAT_MonthlySummary> TMP_VATMonthlySummary1 = new List <VAT_MonthlySummary>(); ReportTitle = "Monthly Overtime Summary Report"; ReportPath = ReportPath + "MonthlyOvertimeSummary.rdlc"; reportViewer = LoadReport_VATMonthlySummary(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATMonthlySummary1, VATMonthlySummary1), reportViewer); break; case "monthly_attendanceedit": ///MONTHLY ATTENDANCE EDIT REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_MonthDataEdit where (PayrollPeriodID >=" + PayrollPeriodIDStart + " and PayrollPeriodID <=" + PayrollPeriodIDEnd + " )" + query); List <VAT_MonthDataEdit> VATMonthDataEdit = dataTable.ToList <VAT_MonthDataEdit>(); List <VAT_MonthDataEdit> TMP_VATMonthDataEdit = new List <VAT_MonthDataEdit>(); ReportTitle = "Monthly Attendance Edit Report"; ReportPath = ReportPath + "MonthlyAttendanceEdit.rdlc"; reportViewer = LoadReport_VATMonthDataEdit(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATMonthDataEdit, VATMonthDataEdit), reportViewer); break; case "monthly_overtimeapproval": ///MONTHLY OVERTIME APPROVAL REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_OvertimeHistory where (PayrollPeriodID >=" + PayrollPeriodIDStart + " and PayrollPeriodID <=" + PayrollPeriodIDEnd + " )" + query); List <VAT_OvertimeHistory> VATOvertimeHistory = dataTable.ToList <VAT_OvertimeHistory>(); List <VAT_OvertimeHistory> TMP_VATOvertimeHistory = new List <VAT_OvertimeHistory>(); ReportTitle = "Monthly Overtime Approval History Report"; ReportPath = ReportPath + "OvertimeApprovalHistory.rdlc"; reportViewer = LoadReport_VATOvertimeHistory(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATOvertimeHistory, VATOvertimeHistory), reportViewer); break; #endregion #region --------Daily Attendance Reports---------------- case "consolidated_attendance": //CONSOLIDATED ATTENDANCE REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Employee Consolidated Report"; ReportPath = ReportPath + "DRConsolidated.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "daily_attendance_summary": dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Daily Attendance Summary Report"; ReportPath = ReportPath + "SMDailyAtt.rdlc"; reportViewer = LoadReport_DailyAttendanceSummary(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "consolidated_attendance_download": //CONSOLIDATED ATTENDANCE DOWNLOADER List <VHR_EmployeeProfile> VHREmployeeProfile2 = DDService.GetEmployeeInfo(LoggedInUser); List <VHR_EmployeeProfile> TMP_vHREmployeeProfile2 = new List <VHR_EmployeeProfile>(); VHREmployeeProfile2 = AttendanceFilter.ReportsFilterImplementation(vmf, TMP_vHREmployeeProfile2, VHREmployeeProfile2); string val = ""; val = AttReportingService.GetDailyReportInExcel(VHREmployeeProfile2, LoggedInUser, Convert.ToDateTime(DateFromS), Convert.ToDateTime(DateToS)); if (val != "") { byte[] fileBytes = System.IO.File.ReadAllBytes(val); string fileName = "ConsolidatedReport.xls"; return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName)); } break; case "missing_attendance": /// EMPLOYEE'S MISSING ATTENDANCE REPORTS dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where ((TimeIn is null and TimeOut is not null) or (TimeIn is not null and TimeOut is null)) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Employee Missing Attendence Report"; ReportPath = ReportPath + "DRMissingAtt.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "multipleinout_attendance": /// EMPLOYEE'S MULTIPLE IN/OUT REPORTS dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendanceDetail where (Tin1 is not null or Tout1 is not null) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); List <VAT_DailyAttendanceDetail> VATDailyAttendanceDetail = dataTable.ToList <VAT_DailyAttendanceDetail>(); List <VAT_DailyAttendanceDetail> TMP_VATDailyAttendanceDetail = new List <VAT_DailyAttendanceDetail>(); ReportTitle = "Employee Multiple In/Out Report"; ReportPath = ReportPath + "DRMultipleInOut.rdlc"; reportViewer = LoadReport_VATDailyAttendanceDetail(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendanceDetail, VATDailyAttendanceDetail), reportViewer); break; case "present_attendance": ///PRESENT EMPLOYEE REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (PDays>0) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Present Employees Report"; ReportPath = ReportPath + "DRPresent.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "absent_attendance": //ABSENT EMPLOYEES REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (AbDays>0) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Absent Employees Report"; ReportPath = ReportPath + "DRAbsent.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "latein_attendance": ///LATE IN EMPLOYEES REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (LateIn>0) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "LateIn Employees Report"; ReportPath = ReportPath + "DRLateIn.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "lateout_attendance": dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (LateOut>0) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "LateOut Employees Report"; ReportPath = ReportPath + "DRLateOut.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "earlyin_attendance": dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (EarlyIn>0) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "EarlyIn Employees Report"; ReportPath = ReportPath + "DREarlyIn.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "earlyout_attendance": dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (EarlyOut>0) and (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "EarlyOut Employees Report"; ReportPath = ReportPath + "DREarlyOut.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "overtime_attendance": dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where ((ApprovedOT>0 or ApprovedDoubleOT>0 or ApprovedCPL>0 ) and AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Employees Overtime Report"; ReportPath = ReportPath + "DROverTime.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "edit_attendance": ////WHO EDITED ATTENDANCE AND WHEN REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttedanceEdit where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " ) " + QueryBuilder.GetReportQueryForLoggedUser2(LoggedInUser, DDService.GetEmployeeInfo())); List <VAT_DailyAttedanceEdit> VATDailyAttedanceEdit = dataTable.ToList <VAT_DailyAttedanceEdit>(); List <VAT_DailyAttedanceEdit> TMP_VATDailyAttendanceEdit = new List <VAT_DailyAttedanceEdit>(); ReportTitle = "Manual Attendance User Log Report"; ReportPath = ReportPath + "EditAttendanceLog.rdlc"; reportViewer = LoadReport_VATDailyAttedanceEdit(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendanceEdit, VATDailyAttedanceEdit), reportViewer); break; #endregion #region -------LEAVE REPORTS------------ case "leave_report": /// EMPLOYEEWISE LEAVE REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_LeaveData where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); List <VAT_LeaveData> VATLeaveData = dataTable.ToList <VAT_LeaveData>(); List <VAT_LeaveData> TMP_VATLeaveData = new List <VAT_LeaveData>(); ReportTitle = "Employee wise consolidated Leave Report"; ReportPath = ReportPath + "DRLeave.rdlc"; reportViewer = LoadReport_VATLeaveData(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATLeaveData, VATLeaveData), reportViewer); break; case "leavedatewise_report": //DATEWISE LEAVE REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_LeaveData where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " )" + query); VATLeaveData = dataTable.ToList <VAT_LeaveData>(); TMP_VATLeaveData = new List <VAT_LeaveData>(); ReportTitle = "Date wise Leave Report"; ReportPath = ReportPath + "DRLeaveDate.rdlc"; reportViewer = LoadReport_VATLeaveData(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATLeaveData, VATLeaveData), reportViewer); break; case "leavebalance_report": ///YEARLY LEAVE BALANCE REPORT List <VHR_EmployeeProfile> VHREmployeeProfile = DDService.GetEmployeeInfo(LoggedInUser); List <VHR_EmployeeProfile> TMP_vHREmployeeProfile = new List <VHR_EmployeeProfile>(); VHREmployeeProfile = AttendanceFilter.ReportsFilterImplementation(vmf, TMP_vHREmployeeProfile, VHREmployeeProfile); ReportTitle = "Yearly Leave Ledger Report"; ReportPath = ReportPath + "DRLeaveBalance.rdlc"; DateTitle = "Yearly Leaves Balance Statement"; reportViewer = LoadReport_vMLeaveBalance(AttReportingService.GetYearlyLeaveBalance(VHREmployeeProfile, FinancialYearID), reportViewer); break; case "monthlyleavebalance_report": //MONTHLY LEAVE BALANCE REPORT List <VHR_EmployeeProfile> VHREmployeeProfile1 = DDService.GetEmployeeInfo(LoggedInUser); List <VHR_EmployeeProfile> TMP_vHREmployeeProfile1 = new List <VHR_EmployeeProfile>(); VHREmployeeProfile = AttendanceFilter.ReportsFilterImplementation(vmf, TMP_vHREmployeeProfile1, VHREmployeeProfile1.Where(aa => aa.Status == "Active").ToList()); ReportTitle = "Monthly Leave Ledger Report"; ReportPath = ReportPath + "DRMonthlyLeaveData.rdlc"; reportViewer = LoadReport_vMMonthlyLeaveBalance(AttReportingService.GetMonthlyLeaveBalance(VHREmployeeProfile, FinancialYearID, Convert.ToDateTime(DateFromS), Convert.ToDateTime(DateToS)), reportViewer); break; case "leaveBalanceEmp_report": ///YEARLY LEAVE BALANCE REPORT VHREmployeeProfile = DDService.GetEmployeeInfo(LoggedInUser); TMP_vHREmployeeProfile = new List <VHR_EmployeeProfile>(); VHREmployeeProfile = AttendanceFilter.ReportsFilterImplementation(vmf, TMP_vHREmployeeProfile, VHREmployeeProfile); ReportTitle = "Yearly Leave Ledger Report"; ReportPath = ReportPath + "YEmpLeaveBalance.rdlc"; FinancialYear dbFinancialYear = DDService.GetFinancialYear().Where(aa => aa.PFinancialYearID == FinancialYearID).First(); DateTitle = "Leave Balance Statement from Year: " + dbFinancialYear.FYName; reportViewer = LoadReport_vMLeaveBalanceWithSR(AttReportingService.GetYearlyLeaveBalance(VHREmployeeProfile, FinancialYearID), reportViewer); break; case "cplexpire_report": ///CPL Expire report REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_CPLBalance where (ExpireDate >= " + "'" + DateFromS + "'" + " and ExpireDate <= " + "'" + DateToS + "'" + " and IsExpire = 1)" + query); List <VAT_CPLBalance> VATCPLBalance = dataTable.ToList <VAT_CPLBalance>(); List <VAT_CPLBalance> TMP_VATCPLBalance = new List <VAT_CPLBalance>(); ReportTitle = "CPL Balance report"; ReportPath = ReportPath + "CPLExpire.rdlc"; reportViewer = LoadReport_VATCPLBalance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATCPLBalance, VATCPLBalance), reportViewer); break; #endregion #region ---------MISCELLANEOUS REPORTS----------------- case "devicedata_report": //DEVICE DATA REPORT dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DeviceData where (EntDate >= " + "'" + DateFromS + "'" + " and EntDate <= " + "'" + DateToS + "'" + " )" + query); List <VAT_DeviceData> VATDeviceData = dataTable.ToList <VAT_DeviceData>(); List <VAT_DeviceData> TMP_VATDeviceData = new List <VAT_DeviceData>(); ReportTitle = "Device Data Report"; ReportPath = ReportPath + "DRDeviceData.rdlc"; reportViewer = LoadReport_VATDeviceData(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDeviceData, VATDeviceData), reportViewer); break; case "unregatt_report": // Un registered employees dataTable = QueryBuilder.GetValuesfromDB("select * from VAT_DailyAttendance where (AttDate >= " + "'" + DateFromS + "'" + " and AttDate <= " + "'" + DateToS + "'" + " and LocationID = " + "'" + 144 + "'" + " )"); VATDailyAttendance = dataTable.ToList <VAT_DailyAttendance>(); TMP_VATDailyAttendance = new List <VAT_DailyAttendance>(); ReportTitle = "Un-registered Employee Consolidated Report"; ReportPath = ReportPath + "DRUnRegEmpAtt.rdlc"; reportViewer = LoadReport_VATDailyAttendance(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_VATDailyAttendance, VATDailyAttendance), reportViewer); break; case "employee_record": dataTable = QueryBuilder.GetValuesfromDB("select * from VHR_EmployeeProfile"); VHREmployeeProfile = dataTable.ToList <VHR_EmployeeProfile>(); TMP_vHREmployeeProfile = new List <VHR_EmployeeProfile>(); ReportTitle = "Employee Records"; ReportPath = ReportPath + "HREmployeeDetail.rdlc"; reportViewer = LoadReport_VHREmployeeProfile(AttendanceFilter.ReportsFilterImplementation(vmf, TMP_vHREmployeeProfile, VHREmployeeProfile), reportViewer); break; #endregion } ViewBag.ReportViewer = reportViewer; return(View()); }
public async Task <ActionResult> GetSystemNotification() { return(await Task.Run(() => { StringBuilder list = new StringBuilder(); VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; List <VHR_EmployeeProfile> vmList = new List <VHR_EmployeeProfile>(); int NotificationCount = 0; VMNotification vmNotification = new VMNotification(); if (LoggedInUser.UserAccessTypeID == 2 || LoggedInUser.UserAccessTypeID == 1) { if (LoggedInUser.UserAccessTypeID == Convert.ToInt32(UserAccessType.AllEmployees)) { Expression <Func <VHR_EmployeeProfile, bool> > SpecificEntries = c => c.Status == "Active"; vmList = VHREmployeeService.GetIndexSpecific(SpecificEntries); } else if (LoggedInUser.UserAccessTypeID == Convert.ToInt32(UserAccessType.LocationBased)) { if (LoggedInUser.UserLoctions != null) { foreach (var userLocaion in LoggedInUser.UserLoctions) { Expression <Func <VHR_EmployeeProfile, bool> > SpecificEntries = c => c.LocationID == userLocaion.LocationID && c.Status == "Active" && c.Status == "Active"; vmList.AddRange(VHREmployeeService.GetIndexSpecific(SpecificEntries)); } } } if (vmList.Count > 0) { if (vmList.Where(aa => aa.ShiftID == null).Count() > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Shifts are not assigned to " + vmList.Where(aa => aa.ShiftID == null).Count().ToString() + " employees.", "Incomplete employee Information", GenerateLinkForSystemNotifications("Shift").ToString())); } if (vmList.Where(aa => aa.LineManagerID == null).Count() > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-commit", "btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm", "Line Managers are not assigned to " + vmList.Where(aa => aa.LineManagerID == null).Count().ToString() + " employees.", "Incomplete employee Information", GenerateLinkForSystemNotifications("LM").ToString())); } if (vmList.Where(aa => aa.CrewID == null).Count() > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Crews are not assigned to " + vmList.Where(aa => aa.CrewID == null).Count().ToString() + " employees.", "Incomplete employee Information", GenerateLinkForSystemNotifications("Crew").ToString())); } if (vmList.Where(aa => aa.FPID == null).Count() > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "FPIDs are not assigned to " + vmList.Where(aa => aa.FPID == null).Count().ToString() + " employees.", "Incomplete employee Information", GenerateLinkForSystemNotifications("FPID").ToString())); } // Ccheck for employees wjo dows not have leave balance int FinYearID = ATAssistant.GetFinancialYearID(DateTime.Today, DDService.GetFinancialYear()); Expression <Func <LeaveQuotaYear, bool> > SpecificEntries2 = c => c.FinancialYearID == FinYearID; int EmpWithNoQuota = AppAssistant.GetEmployeeWithNoLeaveQuota(LeaveQuotaYearService.GetIndexSpecific(SpecificEntries2).ToList(), vmList); if (EmpWithNoQuota > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Leave Quota are not assigned to " + EmpWithNoQuota.ToString() + " employees.", "Incomplete employee Information", GenerateLinkForSystemNotifications("LQ").ToString())); } } if (LoggedInUser.UserAccessTypeID == 3) { Expression <Func <VHR_OrganizationalUnit, bool> > SpecificEntries2 = c => c.OUCommonID == null; List <VHR_OrganizationalUnit> OUList = VHROrganizationalUnitService.GetIndexSpecific(SpecificEntries2); if (OUList.Count() > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-merge", "btn border-success text-success btn-flat btn-rounded btn-icon btn-sm", "Common OU are not assigned to " + OUList.Count().ToString() + " orgaizational units.", "Incomplete Organizatinal units Information", GenerateLinkForSystemNotifications("OrganizationalUnit").ToString())); } Expression <Func <VHR_JobTitle, bool> > SpecificEntries3 = c => c.JTCommonID == null; List <VHR_JobTitle> JTList = VHRJobTitleService.GetIndexSpecific(SpecificEntries3); if (JTList.Count() > 0) { NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Common Job titles are not assigned to " + JTList.Count().ToString() + " job titles.", "Incomplete Job Titles Information", GenerateLinkForSystemNotifications("JobTitle").ToString())); } } } Expression <Func <Notification, bool> > SpecificEntries4 = c => c.UserID == LoggedInUser.PUserID && c.Status == true; List <Notification> NotificationList = NotificationService.GetIndexSpecific(SpecificEntries4).OrderByDescending(aa => aa.PNotificationID).ToList(); foreach (var item in NotificationList.Select(x => new { x.NotificationTypeID, x.NotificationURL }).Distinct()) { switch (item.NotificationTypeID) { ///ESSP LEAVE NOTIFICATIONS case 1: //Pending NotificationCount++; list.Append(GenerateSingleNotification("icon-git-merge", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Pending Leave Request", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " pending leave application", item.NotificationURL)); break; case 2: //Approved NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Approved Leave Request", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " approved leave application", item.NotificationURL)); break; case 3: //Reject NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Rejected Leave Request", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " rejected leave application", item.NotificationURL)); break; ///ESSP LEAVE NOTIFICATIONS case 10: //Pending JC NotificationCount++; list.Append(GenerateSingleNotification("icon-git-merge", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Pending Job Card Request", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " pending job card", item.NotificationURL)); break; case 11: //Approved jc NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Approved Job Card Request", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " approved job card", item.NotificationURL)); break; case 12: //Reject jc NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Rejected Job Card Request", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " rejected job card", item.NotificationURL)); break; /// OBJECTIVE SETTING NOTIFICATIONS case 4: //Pending NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Individual Objective Setting Launched", "Please click above to proceed. ", item.NotificationURL)); break; case 5: //SubmittedToLM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Objective Setting for Review", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " employee's objectives for review.", item.NotificationURL)); break; case 6: //Recommend NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Individual Objective Settings for Approval", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " employee's objectives for review.", item.NotificationURL)); break; case 7: //RevertToEmployee NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Individual Objectives are Reverted", "Please click above to proceed. ", item.NotificationURL)); break; case 8: //RevertToLM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Objective Settings Reverted", "Please click above to proceed. ", item.NotificationURL)); break; case 9: //Approved NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Objectives Sign-off", "Please click above to proceed. ", item.NotificationURL)); break; case 13: //Notification to employee when LM recommends the Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Objectives have been Recommended by Line Manager", "Objectives Approval in Process.", item.NotificationURL)); break; case 17: //Notification to LM when Employee Agrees with Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Agrees with the Objective.", "", item.NotificationURL)); break; case 18: //Notification to LM when Employee DisAgrees with Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Disagrees with the Objective", "", item.NotificationURL)); break; /// Annual Appraisals NOTIFICATIONS case 401: //Pending NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Self Appraisal Launched", "Please click above to proceed ", item.NotificationURL)); break; case 402: //SubmittedToLM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Self Appraisal waiting for your decision", "Please click above to proceed.", item.NotificationURL)); break; case 403: //Recommend NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Managers submit annual appraisals", "Please click above to proceed.", item.NotificationURL)); break; case 404: //RevertToEmployee NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Annual Appraisal is Reverted", "Please click above to proceed.", item.NotificationURL)); break; case 405: //RevertToLM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Annual Appraisal is Reverted", "Please click above to proceed.", item.NotificationURL)); break; case 406: //Approved NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Annual Appraisal Approved", "Please click above to proceed.", item.NotificationURL)); break; case 407: //Notification to employee when LM recommends the Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Objectives have been Recommended by Line Manager", "Please click above to proceed.", item.NotificationURL)); break; case 408: //Notification to LM when Employee Agrees with Annual Appraisal NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Agrees with the Annual Appraisal.", "", item.NotificationURL)); break; case 409: //Notification to LM when Employee DisAgrees with Annual Appraisal NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Disagrees with the Annual Appraisal", "", item.NotificationURL)); break; case 410: //BELL CURVE OK BY DIRECTOR/HOD NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Performance Curve Has been Approved by the HOD", "Please click above to proceed. ", item.NotificationURL)); break; ////////////////////////FEEDBACK MEETING NOTIFICATIONS case 14: //Open NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Performance Feedback Meeting Launched", "Click above to proceed", item.NotificationURL)); break; case 15: //CLOSED BY LM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Performance Feedback Meeting is Closed By LM", "Click here to close Performance Feedback Meeting ", item.NotificationURL)); break; case 16: //Closed NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Performance Feedback Meeting is Closed", "", item.NotificationURL)); break; /// MID YEAR REVIEW NOTIFICATIONS case 501: //Pending NotificationCount++; list.Append(GenerateSingleNotification("icon-git-branch", "btn border-info text-info btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Review Launched", "Please click above to proceed.", item.NotificationURL)); break; case 502: //SubmittedToLM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Pending for Review", "Please click above to proceed.", item.NotificationURL)); break; case 503: //Recommend NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Review for Approval", "Please click above .", item.NotificationURL)); break; case 504: //RevertToEmployee NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Review is Reverted", "Please click above to proceed.", item.NotificationURL)); break; case 505: //RevertToLM NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Review Reverted", "Please click above to proceed.", item.NotificationURL)); break; case 506: //Approved NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Review Sign-off", "Please click above to proceed.", item.NotificationURL)); break; case 507: //Notification to employee when LM recommends the Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Mid-Year Review Has been Recommended by Line Manager", "Please click above to proceed.", item.NotificationURL)); break; case 508: //Notification to LM when Employee Agrees with Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Agrees with the Mid-Year Review.", "", item.NotificationURL)); break; case 509: //Notification to LM when Employee DisAgrees with Objective. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Disagrees with the Mid-Year Review", "", item.NotificationURL)); break; ////Recruitment Position Approval notifications case 111: //Pending NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Pending Position Approval", "Please click at above to approve or revert.", item.NotificationURL)); break; case 116: //Approved NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Position Approved", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " approved position.Please click above to view approved position", item.NotificationURL)); break; case 117: //Reject NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Position Reverted", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " reverted position.Please click above to view and again submitt.", item.NotificationURL)); break; ////Recruitment Position Requisition notifications case 200: //InitiateER NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Pending Employee Requisition", "Please click at above to approve or revert.", item.NotificationURL)); break; case 201: //ApprovedER NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Requisition Approval", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " approved employee requisition.Please click above to check candidates for initial shortlisting.", item.NotificationURL)); break; case 202: //Revert ER NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Requisition Reverted", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " reverted employee requisition.Please click above to view and again submitt.", item.NotificationURL)); break; case 206: //Open Shortliting Stage NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Short-listing Open", "Please click at here to view requisition and start shortliting.", item.NotificationURL)); break; case 203: //Initial Shortlisting NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Initial Shortliting", "Please click at above for initial shortlisting.", item.NotificationURL)); break; case 204: //Final Shortlisting NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Final Shortlisting", "Please click at above for Final shortlisting.", item.NotificationURL)); break; case 205: //Interview Schedule NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Final Short-listing Closed", "Please click above to schedule interview for final shortlisted candidates.", item.NotificationURL)); break; case 207: //Test Schedule NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Final Short-listing Closed", "Please click above to schedule test for final shortlisted candidates.", item.NotificationURL)); break; case 218: //Marks Enter NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Test Done", "Please click at above to enter marks of candidates.", item.NotificationURL)); break; case 211: //Test Submission NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Marks Entry Done", "Please click at above to submit marks to HR.", item.NotificationURL)); break; case 210: //Interview Schedule after Test NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Test Stage Completed", "Please click at above to schedule interview.", item.NotificationURL)); break; case 212: //Interview Remarks Entry NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Interview Done", "Please click at above to add remarks against each interview.", item.NotificationURL)); break; case 213: //Interview Submission NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Interview Stage Completed", "Please click at above to create merit list.", item.NotificationURL)); break; case 214: //Interview Submission NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Merit List Submission", "Please click at above to approve merit list.", item.NotificationURL)); break; case 215: //Interview Submission NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Merit List Approved", "Please click at above to see approve merit list.", item.NotificationURL)); break; // NOTIFICATION FOR EMPLOYEE PROBATION //RecommendByLM = 601, //RecommendByLM1 = 602, //Approve = 603, //Reject = 604, //RevertToLM = 605, //RevertToLM1 = 606 case 601: //Notification to Line Manager +1 when LM recommends the Probation. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee's Probation Recommended by Line Manager", "Evaluate the Employee's Probation.", item.NotificationURL)); break; case 602: //Notification to Director when LM+1 Approves the Probation. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee's Probation Approved and Recommended by Line Manager +1 ", "Evaluate the Employee's Probation.", item.NotificationURL)); break; case 604: //Notification to LM For Pending Probation. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee's Probation Pending for Recommendation", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " pending Probation Evaluation", item.NotificationURL)); break; case 605: //Notification to LM when LM+1 Reverts the Probation. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee's Probation Reverted by Line Manager +1 ", "Re-Evaluate the Employee's Probation.", item.NotificationURL)); break; case 606: //Notification to LM+1 when Director Reverts the Probation. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee's Probation Reverted By Director", "Re-Evaluate the Employee's Probation.", item.NotificationURL)); break; case 607: //Notification to LM that employee has been Hired NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee has been Hired by the HR Officer", ".", item.NotificationURL)); break; case 608: //Notification to LM that employee extension is expiring NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Extension is going to expire soon", ".", item.NotificationURL)); break; case 609: //Notification to HR NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee Probation Has been Rejected By the Director", ".", item.NotificationURL)); break; case 603: //Notification to HR NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Employee has successfully been probated by Director", "Click above to see the decision", item.NotificationURL)); break; // NOTIFICATION FOR Feedback Session //Pending = 1000, //Submitted = 1001, case 1000: //Notification to Employee When Session Starts. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Feedback Evalution Pending", "Feedback is pending at your desk.Please click at above to view", item.NotificationURL)); break; case 1001: //Notification to Creator When Submitted. NotificationCount++; list.Append(GenerateSingleNotification("icon-git-pull-request", "btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm", "Feedback Evaluation Submitted", "You have " + NotificationList.Where(aa => aa.NotificationTypeID == item.NotificationTypeID).Count().ToString() + " submitted feedback from employees.", item.NotificationURL)); break; } } vmNotification.Notification = list.ToString(); vmNotification.NotificationCount = NotificationCount.ToString(); return Json(vmNotification, JsonRequestBehavior.AllowGet); })); }