protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String reportName = Request.QueryString["reportname"]; List<string> list = Session["ReportSession"] as List<string>; FiltersModel fm = Session["FiltersModel"] as FiltersModel; User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); _dateFrom = list[0]; string _dateTo = list[1]; DateTime DateFrom = Convert.ToDateTime(list[0]); DateTime DateTo = Convert.ToDateTime(list[1]); string PathString = ""; string consolidatedMonth = ""; switch (reportName) { case "Strength": List<DailySummary> _BadliList = contex.DailySummaries.Where(aa => aa.Date >= DateFrom && aa.Date <= DateTo).ToList(); List<DailySummary> _TempBadliList = new List<DailySummary>(); title = "Badli Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList),_dateFrom+" TO "+_dateTo); break; case "WorkTime": _BadliList = contex.DailySummaries.Where(aa => aa.Date >= DateFrom && aa.Date <= DateTo).ToList(); _TempBadliList = new List<DailySummary>(); title = "Badli Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList), _dateFrom + " TO " + _dateTo); break; case "Consolidated": _BadliList = contex.DailySummaries.Where(aa => aa.Date >= DateFrom && aa.Date <= DateTo).ToList(); _TempBadliList = new List<DailySummary>(); title = "Badli Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList), _dateFrom + " TO " + _dateTo); break; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DivGridSection.Visible = false; DivGridCrew.Visible = false; DivGridDept.Visible = false; DivGridEmp.Visible = false; DivShiftGrid.Visible = false; DivLocGrid.Visible = false; DivTypeGrid.Visible = false; ReportViewer1.Visible = true; ReportViewer1.Width = 1050; ReportViewer1.Height = 700; DivGridComapny.Visible = false; SelectedComps.Clear(); SelectedTypes.Clear(); SelectedCrews.Clear(); SelectedDepts.Clear(); SelectedEmps.Clear(); SelectedLocs.Clear(); SelectedSections.Clear(); SelectedShifts.Clear(); LoadGridViews(); RefreshLabels(); DateTime date = DateTime.Today.Date; if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/DROverTime.rdlc"; } else PathString = "/WMS/Reports/RDLC/DROverTime.rdlc"; User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and AttDate = '" + date.Date.Year.ToString() + "-" + date.Date.Month.ToString() + "-" + date.Date.Day.ToString() + "'" + " and ( StatusOT=1 or StatusGZOT = 1 ) "); List<ViewAttData> _View = dt.ToList<ViewAttData>(); LoadReport(PathString, _View); } }
protected void btnGenerateReport_Click(object sender, EventArgs e) { RefreshLabels(); DivGridSection.Visible = false; DivGridCrew.Visible = false; DivGridDept.Visible = false; DivGridEmp.Visible = false; DivShiftGrid.Visible = false; DivLocGrid.Visible = false; DivTypeGrid.Visible = false; ReportViewer1.Visible = true; DivGridComapny.Visible = false; DivGridComapny.Visible = false; List<ViewAttData> _TempViewList = new List<ViewAttData>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); string _dateTo = "'" + DateTo.Date.Year.ToString() + "-" + DateTo.Date.Month.ToString() + "-" + DateTo.Date.Day.ToString() + "'"; string _dateFrom = "'" + DateFrom.Date.Year.ToString() + "-" + DateFrom.Date.Month.ToString() + "-" + DateFrom.Date.Day.ToString() + "'"; DataTable dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + _dateFrom + " and AttDate <= " + _dateTo + " )" + " and ( StatusOT=1 " + "or StatusGZOT = 1) "); List<ViewAttData> _ViewList = dt.ToList<ViewAttData>(); //_ViewList = context.ViewAttDatas.Where(aa => aa.AttDate >= DateFrom.Date && aa.AttDate <= DateTo.Date && (aa.StatusOT == true || aa.StatusGZOT == true)).ToList(); if (SelectedEmps.Count > 0) { foreach (var emp in SelectedEmps) { _TempViewList.AddRange(_ViewList.Where(aa => aa.EmpID == emp.EmpID).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for department if (SelectedDepts.Count > 0) { foreach (var dept in SelectedDepts) { _TempViewList.AddRange(_ViewList.Where(aa => aa.DeptName == dept.DeptName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for company if (SelectedComps.Count > 0) { foreach (var comp in SelectedComps) { _TempViewList.AddRange(_ViewList.Where(aa => aa.CompName == comp.CompName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for sections if (SelectedSections.Count > 0) { foreach (var sec in SelectedSections) { _TempViewList.AddRange(_ViewList.Where(aa => aa.SectionName == sec.SectionName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for crews if (SelectedCrews.Count > 0) { foreach (var cre in SelectedCrews) { _TempViewList.AddRange(_ViewList.Where(aa => aa.CrewName == cre.CrewName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for location if (SelectedLocs.Count > 0) { foreach (var loc in SelectedLocs) { _TempViewList.AddRange(_ViewList.Where(aa => aa.LocName == loc.LocName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for shifts if (SelectedShifts.Count > 0) { foreach (var shift in SelectedShifts) { _TempViewList.AddRange(_ViewList.Where(aa => aa.ShiftName == shift.ShiftName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for category if (SelectedTypes.Count > 0) { foreach (var cat in SelectedTypes) { _TempViewList.AddRange(_ViewList.Where(aa => aa.TypeName == cat.TypeName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/DROverTime.rdlc"; } else PathString = "/WMS/Reports/RDLC/DROverTime.rdlc"; LoadReport(PathString, _ViewList); }
protected void Page_Load(object sender, EventArgs e) { String reportName = Request.QueryString["reportname"]; String type = Request.QueryString["type"]; if (!Page.IsPostBack) { List<string> list = Session["ReportSession"] as List<string>; FiltersModel fm = Session["FiltersModel"] as FiltersModel; CreateDataTable(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); _dateFrom = list[0]; string _dateTo = list[1]; companyimage = GetCompanyImages(fm); string PathString = ""; string consolidatedMonth = ""; switch (reportName) { case "badli_report": DataTable badlidt = qb.GetValuesfromDB("select * from ViewBadli where (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); List<ViewBadli> _BadliList = badlidt.ToList<ViewBadli>(); List<ViewBadli> _TempBadliList = new List<ViewBadli>(); title = "Badli Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/BadliReport.rdlc"; else PathString = "/WMS/Reports/RDLC/BadliReport.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempBadliList, _BadliList), _dateFrom + " TO " + _dateTo); break; //please modify the first case case "summarized_monthly_report": List<TASReportDataSet.SummarizedMonthlyReportDataTable> AttDeptdummy = new List<TASReportDataSet.SummarizedMonthlyReportDataTable>().ToList(); title = "Department Attendace Summary"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/SummarizedMonthlyReport.rdlc"; else PathString = "/WMS/Reports/RDLC/SummarizedMonthlyReport.rdlc"; LoadReport(PathString, AttDeptdummy, _dateFrom + " TO " + _dateTo); break; case "Employee_Att_Summary_New_report": DataTable dt4 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1" + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); List<ViewAttData> ListOfAttDate = new List<ViewAttData>(); List<ViewAttData> TempList = new List<ViewAttData>(); title = "Employee Attendace Summary New"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/EmpAttSummaryNew.rdlc"; else PathString = "/WMS/Reports/RDLC/EmpAttSummaryNew.rdlc"; ListOfAttDate = dt4.ToList<ViewAttData>(); TempList = new List<ViewAttData>(); LoadReport(PathString, ReportsFilterImplementation(fm, TempList, ListOfAttDate), _dateFrom + " TO " + _dateTo); break; //case "department_attendance_summary": HRReportsMaker hrm = new HRReportsMaker(); // List<AttDeptSummary> AttDept = hrm.GetListForAttDepartmentsSummary(Session["FiltersModel"] as FiltersModel, _dateFrom, _dateTo); // title = "Department Attendace Summary"; // if (GlobalVariables.DeploymentType == false) // PathString = "/Reports/RDLC/AttDepartmentSummary.rdlc"; // else // PathString = "/WMS/Reports/RDLC/AttDepartmentSummary.rdlc"; // LoadReport(PathString, AttDept, _dateFrom + " TO " + _dateTo); // break; case "emp_record": DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=1 "); List<EmpView> _ViewList = dt.ToList<EmpView>(); List<EmpView> _TempViewList = new List<EmpView>(); title = "Employee Record Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/Employee.rdlc"; else PathString = "/WMS/Reports/RDLC/Employee.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList, _ViewList), _dateFrom + " TO " + _dateTo); break; case "emp_record_active": dt = qb.GetValuesfromDB("select * from EmpView " + query+ " and Status=1 "); _ViewList = dt.ToList<EmpView>(); _TempViewList = new List<EmpView>(); title = "Active Employees Record Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/Employee.rdlc"; else PathString = "/WMS/Reports/RDLC/Employee.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList, _ViewList), _dateFrom + " TO " + _dateTo); break; case "emp_record_inactive": dt = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=0 "); _ViewList = dt.ToList<EmpView>(); _TempViewList = new List<EmpView>(); title = "Inactive Employees Record Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/Employee.rdlc"; else PathString = "/WMS/Reports/RDLC/Employee.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList, _ViewList), _dateFrom + " TO " + _dateTo); break; case "emp_detail_excel": DataTable dt1 = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=1 "); List<EmpView> _ViewList1 = dt1.ToList<EmpView>(); List<EmpView> _TempViewList1 = new List<EmpView>(); title = "Employee Detail Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/EmployeeDetail.rdlc"; else PathString = "/WMS/Reports/RDLC/EmployeeDetail.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList1, _ViewList1), _dateFrom + " TO " + _dateTo); break; case "leave_application": dt1 = qb.GetValuesfromDB("select * from ViewLvApplication " + query + " and (FromDate >= '" + _dateFrom + "' and ToDate <= '" + _dateTo + "' )"); List<ViewLvApplication> _ViewListLvApp = dt1.ToList<ViewLvApplication>(); List<ViewLvApplication> _TempViewListLvApp = new List<ViewLvApplication>(); title = "Leave Application Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRLeave.rdlc"; else PathString = "/WMS/Reports/RDLC/DRLeave.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListLvApp, _ViewListLvApp), _dateFrom + " TO " + _dateTo); break; case "detailed_att": DataTable dt2 = qb.GetValuesfromDB("select * from ViewDetailAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); List<ViewDetailAttData> _ViewList2 = dt2.ToList<ViewDetailAttData>(); List<ViewDetailAttData> _TempViewList2 = new List<ViewDetailAttData>(); title = "Detailed Attendence"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRdetailed.rdlc"; else PathString = "/WMS/Reports/RDLC/DRdetailed.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList2, _ViewList2), _dateFrom + " TO " + _dateTo); break; case "consolidated_att": DataTable dt3 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); List<ViewAttData> _ViewList3 = dt3.ToList<ViewAttData>(); List<ViewAttData> _TempViewList3 = new List<ViewAttData>(); title = "Consolidated Attendence Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRAttendance.rdlc"; else PathString = "/WMS/Reports/RDLC/DRAttendance.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList3, _ViewList3), _dateFrom + " TO " + _dateTo); break; case "present": DataTable datatable = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusP = 1 "); List<ViewAttData> _ViewList4 = datatable.ToList<ViewAttData>(); List<ViewAttData> _TempViewList4 = new List<ViewAttData>(); title = "Present Employee Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRPresent.rdlc"; else PathString = "/WMS/Reports/RDLC/DRPresent.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList4, _ViewList4), _dateFrom + " TO " + _dateTo); break; case "absent": DataTable dt5 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusAB = 1 "); List<ViewAttData> _ViewList5 = dt5.ToList<ViewAttData>(); List<ViewAttData> _TempViewList5 = new List<ViewAttData>(); title = "Absent Employee Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRAbsent.rdlc"; else PathString = "/WMS/Reports/RDLC/DRAbsent.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList5, _ViewList5), _dateFrom + " TO " + _dateTo); break; case "lv_application": DataTable dt6 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and (StatusLeave=1 OR StatusHL=1)"); List<ViewAttData> _ViewList6 = dt6.ToList<ViewAttData>(); List<ViewAttData> _TempViewList6 = new List<ViewAttData>(); title = "Leave Attendence Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRAbsent.rdlc"; else PathString = "/WMS/Reports/RDLC/DRAbsent.rdlc"; //LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList6, _ViewList6), _dateFrom + " TO " + _dateTo); //To-do Develop Leave Attendance Report break; case "short_lv": DataTable dt7 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusSL=1"); List<ViewAttData> _ViewList7 = dt7.ToList<ViewAttData>(); List<ViewAttData> _TempViewList7 = new List<ViewAttData>(); title = "Short Leave Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRShortLeave.rdlc"; else PathString = "/WMS/Reports/RDLC/DRShortLeave.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList7, _ViewList7), _dateFrom + " TO " + _dateTo); break; case "late_in": DataTable dt8 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusLI=1 "); List<ViewAttData> _ViewList8 = dt8.ToList<ViewAttData>(); List<ViewAttData> _TempViewList8 = new List<ViewAttData>(); title = "Late In Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRLateIn.rdlc"; else PathString = "/WMS/Reports/RDLC/DRLateIn.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "late_out": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusLO=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Late Out Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRLateOut.rdlc"; else PathString = "/WMS/Reports/RDLC/DRLateOut.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "early_in": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusEI=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Early In Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DREarlyIn.rdlc"; else PathString = "/WMS/Reports/RDLC/DREarlyIn.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "early_out": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusEO=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Early Out Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DREarlyOut.rdlc"; else PathString = "/WMS/Reports/RDLC/DREarlyOut.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "overtime": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusOT=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "OverTime Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DROverTime.rdlc"; else PathString = "/WMS/Reports/RDLC/DROverTime.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "missing_attendance": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1 " + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and ((TimeIn is null and TimeOut is not null) or (TimeIn is not null and TimeOut is null)) "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Missing Attendence Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRMissingAtt.rdlc"; else PathString = "/WMS/Reports/RDLC/DRMissingAtt.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "multiple_in_out": dt = qb.GetValuesfromDB("select * from ViewMultipleInOut " + query + " and Status=1" + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and (Tin1 is not null or TOut1 is not null)"); //change query for multiple_in_out List<ViewMultipleInOut> _ViewList9 = dt.ToList<ViewMultipleInOut>(); List<ViewMultipleInOut> _TempViewList9 = new List<ViewMultipleInOut>(); title = "Multiple In/Out Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRMultipleInOut.rdlc"; else PathString = "/WMS/Reports/RDLC/DRMultipleInOut.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList9, _ViewList9), _dateFrom + " TO " + _dateTo); break; case "monthly_leave_sheet": string _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=1 "); title = "Monthly Leave Sheet for Permanent Employees"; _ViewList1 = dt.ToList<EmpView>(); _TempViewList1 = new List<EmpView>(); if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MLvConsumed.rdlc"; else PathString = "/WMS/Reports/RDLC/MLvConsumed.rdlc"; int monthfrom = Convert.ToDateTime(_dateFrom).Month; int monthTo = Convert.ToDateTime(_dateTo).Month; //int totalMonths = monthfrom < monthTo ? monthTo : monthfrom; for (int ul = monthfrom > monthTo ? monthTo : monthfrom; ul <= (monthfrom < monthTo ? monthTo : monthfrom); ul++) { LoadReport(PathString, GetLV(ReportsFilterImplementation(fm, _TempViewList1, _ViewList1), 2), ul); } // LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList1, _ViewList1), _dateFrom); break; case "monthly_21-20": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Status=1 " + " and" + consolidatedMonth); //dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Sheet (21st to 20th)"; List<ViewMonthlyDataPer> _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); List<ViewMonthlyDataPer> _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSheetP.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSheetP.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "monthly_1-31": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Status=1" + " and" + consolidatedMonth); //dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Period = " + _period); title = "Monthly Sheet (1st to 31st)"; List<ViewMonthlyData> _ViewListMonthlyData = dt.ToList<ViewMonthlyData>(); List<ViewMonthlyData> _TempViewListMonthlyData = new List<ViewMonthlyData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSheetC.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSheetC.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyData, _ViewListMonthlyData), _dateFrom); break; case "monthlysummary_21-20": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Status=1" + " and" + consolidatedMonth); //dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Summary Report (21st to 20th)"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "monthlysummary_1-31": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Status=1" + " and" + consolidatedMonth); //dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Summary (1st to 31st)"; _ViewListMonthlyData = dt.ToList<ViewMonthlyData>(); _TempViewListMonthlyData = new List<ViewMonthlyData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSummaryC.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSummaryC.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyData, _ViewListMonthlyData), _dateFrom); break; case "monthly_21-20_excel": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Status=1" + " and" + consolidatedMonth); //dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Sheet (21st to 20th)"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRDetailExcelP.rdlc"; else PathString = "/WMS/Reports/RDLC/MRDetailExcelP.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "monthly_1-31_consolidated": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Status=1" + " and" + consolidatedMonth); title = "Monthly Consolidated Attendance Sheet (1st to 31th)"; _ViewListMonthlyData = dt.ToList<ViewMonthlyData>(); _TempViewListMonthlyData = new List<ViewMonthlyData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRDetailExcelC.rdlc"; else PathString = "/WMS/Reports/RDLC/MRDetailExcelC.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyData, _ViewListMonthlyData), _dateFrom + " to " + _dateTo); break; case "monthly_21-20_consolidated": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); consolidatedMonth = ""; monthfrom = Convert.ToDateTime(_dateFrom).Month; monthTo = Convert.ToDateTime(_dateTo).Month; for (int i = monthfrom; i <= monthTo; i++) { consolidatedMonth = consolidatedMonth + " Period =" + i + Convert.ToDateTime(_dateFrom).Year.ToString() + " OR"; } if (consolidatedMonth.Length > 4) consolidatedMonth = consolidatedMonth.Substring(0, consolidatedMonth.Length - 3); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Status=1" + " and" + consolidatedMonth); title = "Monthly Consolidated (21th to 20th)(Excel)"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRDetailExcelP.rdlc"; else PathString = "/WMS/Reports/RDLC/MRDetailExcelP.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom + " to " + _dateTo); break; case "emp_att": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1" + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); title = "Employee Attendance"; _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/EmpAttSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/EmpAttSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "emp_absent": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and Status=1" + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusAB = 1 "); title = "Employee Absent"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "lv_quota": dt = qb.GetValuesfromDB("select * from EmpView " + query + " and Status=1"); _ViewList1 = dt.ToList<EmpView>(); _TempViewList1 = new List<EmpView>(); if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MYLeaveSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/MYLeaveSummary.rdlc"; LoadReport(PathString, GYL(ReportsFilterImplementation(fm, _TempViewList1, _ViewList1))); // LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; ///////////////////////////////////////////////////////////// /////////////////Summary Reports//////////////////////////// /////////////////////////////////////////////////////////// case "company_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm,_dateFrom,_dateTo,"C"), _dateFrom + " TO " + _dateTo,"Company Consolidated Summary"); break; case "company_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "C"), _dateFrom + " TO " + _dateTo, "Company Strength Summary"); break; case "company_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "C"), _dateFrom + " TO " + _dateTo, "Company Work Times Summary"); break; case "location_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; ReportsFilterImplementation(fm, _dateFrom, _dateTo, "L"); LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "L"), _dateFrom + " TO " + _dateTo, "Location Consolidated Summary"); break; case "location_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "L"), _dateFrom + " TO " + _dateTo, "Location Strength Summary"); break; case "location_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "L"), _dateFrom + " TO " + _dateTo, "Location Work Times Summary"); break; case "shift_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "S"), _dateFrom + " TO " + _dateTo, "Shift Consolidated Summary"); break; case "shift_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "S"), _dateFrom + " TO " + _dateTo, "Shift Strength Summary"); break; case "shift_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "S"), _dateFrom + " TO " + _dateTo, "Shift Work Times Summary"); break; case "category_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "A"), _dateFrom + " TO " + _dateTo, "Category Consolidated Summary"); break; case "category_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "A"), _dateFrom + " TO " + _dateTo, "Category Strength Summary"); break; case "category_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "A"), _dateFrom + " TO " + _dateTo, "Category Work Times Summary"); break; case "type_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "T"), _dateFrom + " TO " + _dateTo, "Employee Type Consolidated Summary"); break; case "type_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "T"), _dateFrom + " TO " + _dateTo, "Employee Type Strength Summary"); break; case "type_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "T"), _dateFrom + " TO " + _dateTo, "Employee Type Work Times Summary"); break; case "dept_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "D"), _dateFrom + " TO " + _dateTo, "Department Consolidated Summary"); break; case "dept_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "D"), _dateFrom + " TO " + _dateTo, "Department Strength Summary"); break; case "dept_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "D"), _dateFrom + " TO " + _dateTo, "Department Work Times Summary"); break; case "section_consolidated": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSConsolidated.rdlc"; else PathString = "/WMS/Reports/RDLC/DSConsolidated.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "E"), _dateFrom + " TO " + _dateTo, "Section Consolidated Summary"); break; case "section_strength": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSEmpStrength.rdlc"; else PathString = "/WMS/Reports/RDLC/DSEmpStrength.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "E"), _dateFrom + " TO " + _dateTo, "Section Strength Summary"); break; case "section_worktimes": if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DSWorkSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/DSWorkSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _dateFrom, _dateTo, "E"), _dateFrom + " TO " + _dateTo, "Section Work Times Summary"); break; } } }
// GET: /Emp/ public ActionResult Index(string sortOrder, string searchString, string currentFilter, int? page) { ViewBag.CurrentSort = sortOrder; ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.DesigSortParm = sortOrder == "designation" ? "designation_desc" : "designation"; ViewBag.LocSortParm = sortOrder == "location" ? "location_desc" : "location"; ViewBag.SectionSortParm = sortOrder == "section" ? "section_desc" : "section"; ViewBag.DepartmentSortParm = sortOrder == "wing" ? "wing_desc" : "wing"; ViewBag.ShiftSortParm = sortOrder == "shift" ? "shift_desc" : "shift"; ViewBag.TypeSortParm = sortOrder == "type" ? "type_desc" : "type"; //List<EmpView> emps = new List<EmpView>(); if (searchString != null) { page = 1; } else { searchString = currentFilter; } User LoggedInUser = Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from EmpView"+query); List<EmpView> emps = dt.ToList<EmpView>(); ViewBag.CurrentFilter = searchString; if (!String.IsNullOrEmpty(searchString)) { if (searchString == "Active" || searchString == "active") { emps = emps.Where(aa => aa.Status == true).ToList(); } else if (searchString == "Inactive" || searchString == "inactive") { emps = emps.Where(aa => aa.Status == false).ToList(); } else { try { emps = emps.Where(s => s.EmpName.ToUpper().Contains(searchString.ToUpper()) || s.EmpNo.Contains(searchString.ToUpper()) || s.SectionName.ToUpper().Contains(searchString.ToUpper()) || s.ShiftName.ToUpper().Contains(searchString.ToUpper()) || s.DesignationName.ToUpper().Contains(searchString.ToUpper())).ToList(); } catch(Exception ex) { } } } switch (sortOrder) { case "name_desc": emps = emps.OrderByDescending(s => s.EmpName).ToList(); break; case "designation_desc": emps = emps.OrderByDescending(s => s.DesignationName).ToList(); break; case "designation": emps = emps.OrderBy(s => s.DesignationName).ToList(); break; case "location_desc": emps = emps.OrderByDescending(s => s.LocName).ToList(); break; case "location": emps = emps.OrderBy(s => s.LocName).ToList(); break; case "section_desc": emps = emps.OrderByDescending(s => s.SectionName).ToList(); break; case "section": emps = emps.OrderBy(s => s.SectionName).ToList(); break; //case "wing_desc": // emps = emps.OrderByDescending(s => s.sec.DeptName).ToList(); // break; //case "wing": // emps = emps.OrderBy(s => s.DeptName).ToList(); // break; case "shift_desc": emps = emps.OrderByDescending(s => s.ShiftName).ToList(); break; case "shift": emps = emps.OrderBy(s => s.ShiftName).ToList(); break; case "type_desc": emps = emps.OrderByDescending(s => s.TypeName).ToList(); break; case "type": emps = emps.OrderBy(s => s.TypeName).ToList(); break; default: emps = emps.OrderBy(s => s.EmpName).ToList(); break; } int pageSize = 10; int pageNumber = (page ?? 1); return View(emps.ToPagedList(pageNumber, pageSize)); //var emps = db.Emps.Include(e => e.Company).Include(e => e.Crew).Include(e => e.Designation).Include(e => e.Grade).Include(e => e.JobTitle).Include(e => e.Location).Include(e => e.Section).Include(e => e.Shift).Include(e => e.EmpType).Include(e => e.EmpFace).Include(e => e.EmpFp).Include(e => e.LvQuota); //return View(emps.ToList()); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DivGridSection.Visible = false; DivGridCrew.Visible = false; DivGridDept.Visible = false; DivGridEmp.Visible = false; DivShiftGrid.Visible = false; DivLocGrid.Visible = false; DivTypeGrid.Visible = false; ReportViewer1.Visible = true; ReportViewer1.Width = 1050; ReportViewer1.Height = 700; SelectedTypes.Clear(); SelectedCrews.Clear(); SelectedDepts.Clear(); SelectedEmps.Clear(); SelectedLocs.Clear(); SelectedSections.Clear(); SelectedShifts.Clear(); RefreshLabels(); LoadGridViews(); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/YLvConsumed.rdlc"; } else PathString = "/WMS/Reports/RDLC/YLvConsumed.rdlc"; User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from ViewLvConsumed " + query); List<ViewLvConsumed> _ViewList = dt.ToList<ViewLvConsumed>(); LoadReport(PathString, _ViewList); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DateTime date = DateTime.Today.Date.AddDays(-1); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/DRDetailed.rdlc"; } else PathString = "/WMS/Reports/RDLC/DRDetailed.rdlc"; //List<ViewMultipleInOut> _View = new List<ViewMultipleInOut>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from ViewMultipleInOut " + query +" and AttDate = '"+ date.Date.Year.ToString()+"-"+date.Date.Month.ToString()+"-"+date.Date.Day.ToString()+"'"); List<ViewMultipleInOut> _View = dt.ToList<ViewMultipleInOut>(); LoadReport(PathString, _View); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DivGridSection.Visible = false; DivGridCrew.Visible = false; DivGridDept.Visible = false; DivGridEmp.Visible = false; DivShiftGrid.Visible = false; DivLocGrid.Visible = false; DivTypeGrid.Visible = false; ReportViewer1.Visible = true; ReportViewer1.Width = 1050; ReportViewer1.Height = 700; SelectedTypes.Clear(); SelectedCrews.Clear(); SelectedDepts.Clear(); SelectedEmps.Clear(); SelectedLocs.Clear(); SelectedSections.Clear(); SelectedShifts.Clear(); DivGridComapny.Visible = false; SelectedComps.Clear(); RefreshLabels(); LoadGridViews(); string _period = DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString(); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/MRDetailExcelC.rdlc"; } else PathString = "/WMS/Reports/RDLC/MRDetailExcelC.rdlc"; List<ViewMonthlyData> _ViewList = new List<ViewMonthlyData>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Period='" + _period+"'"); _ViewList = dt.ToList<ViewMonthlyData>(); LoadReport(PathString, _ViewList); } }
public ActionResult JobCardList(string sortOrder, string searchString, string currentFilter, int? page) { ViewBag.CurrentSort = sortOrder; ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.DesigSortParm = sortOrder == "designation" ? "designation_desc" : "designation"; ViewBag.SectionSortParm = sortOrder == "section" ? "section_desc" : "section"; //List<EmpView> emps = new List<EmpView>(); if (searchString != null) { page = 1; } else { searchString = currentFilter; } User LoggedInUser = Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from ViewJobCardApp " + query); List<ViewJobCardApp> jobCardsApps = dt.ToList<ViewJobCardApp>(); // List<EmpView> emps = db.EmpViews.ToList(); ViewBag.CurrentFilter = searchString; if (!String.IsNullOrEmpty(searchString)) { try { jobCardsApps = jobCardsApps.Where(s => s.EmpName.ToUpper().Contains(searchString.ToUpper()) || s.EmpNo.ToUpper().Contains(searchString.ToUpper()) || s.DesignationName.ToString().Contains(searchString) ).OrderByDescending(aa=>aa.DateCreated).ToList(); } catch (Exception ex) { } } switch (sortOrder) { case "name_desc": jobCardsApps = jobCardsApps.OrderByDescending(s => s.EmpName).ToList(); break; case "designation_desc": jobCardsApps = jobCardsApps.OrderByDescending(s => s.DesignationName).ToList(); break; case "designation": jobCardsApps = jobCardsApps.OrderBy(s => s.DesignationName).ToList(); break; case "section_desc": jobCardsApps = jobCardsApps.OrderByDescending(s => s.SectionName).ToList(); break; case "section": jobCardsApps = jobCardsApps.OrderBy(s => s.SectionName).ToList(); break; default: jobCardsApps = jobCardsApps.OrderBy(s => s.EmpName).ToList(); break; } int pageSize = 10; int pageNumber = (page ?? 1); return View(jobCardsApps.ToPagedList(pageNumber, pageSize)); }
// GET: /JobCard/ public ActionResult Index(string sortOrder, string searchString, string currentFilter, int? page) { ViewBag.CurrentSort = sortOrder; ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.DesigSortParm = sortOrder == "designation" ? "designation_desc" : "designation"; ViewBag.LocSortParm = sortOrder == "location" ? "location_desc" : "location"; ViewBag.SectionSortParm = sortOrder == "section" ? "section_desc" : "section"; ViewBag.DepartmentSortParm = sortOrder == "wing" ? "wing_desc" : "wing"; ViewBag.ShiftSortParm = sortOrder == "shift" ? "shift_desc" : "shift"; ViewBag.TypeSortParm = sortOrder == "type" ? "type_desc" : "type"; //List<EmpView> emps = new List<EmpView>(); if (searchString != null) { page = 1; } else { searchString = currentFilter; } User LoggedInUser = Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query); List<EmpView> emps = dt.ToList<EmpView>(); // List<EmpView> emps = db.EmpViews.ToList(); ViewBag.CurrentFilter = searchString; if (!String.IsNullOrEmpty(searchString)) { if (searchString == "Active" || searchString == "active") { emps = emps.Where(aa => aa.Status == true).ToList(); } else if (searchString == "Inactive" || searchString == "inactive") { emps = emps.Where(aa => aa.Status == false).ToList(); } else { try { emps = emps.Where(s => s.EmpName.ToUpper().Contains(searchString.ToUpper()) || s.EmpNo.ToUpper().Contains(searchString.ToUpper()) || s.DesignationName.ToString().Contains(searchString) ).ToList(); } catch (Exception ex) { } } } switch (sortOrder) { case "name_desc": emps = emps.OrderByDescending(s => s.EmpName).ToList(); break; case "designation_desc": emps = emps.OrderByDescending(s => s.DesignationName).ToList(); break; case "designation": emps = emps.OrderBy(s => s.DesignationName).ToList(); break; case "location_desc": emps = emps.OrderByDescending(s => s.LocName).ToList(); break; case "location": emps = emps.OrderBy(s => s.LocName).ToList(); break; case "section_desc": emps = emps.OrderByDescending(s => s.SectionName).ToList(); break; case "section": emps = emps.OrderBy(s => s.SectionName).ToList(); break; case "wing_desc": emps = emps.OrderByDescending(s => s.DeptName).ToList(); break; case "wing": emps = emps.OrderBy(s => s.DeptName).ToList(); break; case "shift_desc": emps = emps.OrderByDescending(s => s.ShiftName).ToList(); break; case "shift": emps = emps.OrderBy(s => s.ShiftName).ToList(); break; case "type_desc": emps = emps.OrderByDescending(s => s.TypeName).ToList(); break; case "type": emps = emps.OrderBy(s => s.TypeName).ToList(); break; default: emps = emps.OrderBy(s => s.EmpName).ToList(); break; } int pageSize = 10; int pageNumber = (page ?? 1); ViewData["JobDateFrom"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewData["JobDateTo"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName"); return View(emps.ToPagedList(pageNumber, pageSize)); }
public ActionResult EditAttJobCard() { User LoggedInUser = Session["LoggedUser"] as User; string Message = ""; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query); List<EmpView> emps = dt.ToList<EmpView>(); try { string _EmpNo = ""; // int CompID = Convert.ToInt16(Request.Form["CompanyID"].ToString()); List<EmpView> _Emp = new List<EmpView>(); short _WorkCardID = Convert.ToInt16(Request.Form["JobCardType"].ToString()); //First Save Job Card Application JobCardApp jobCardApp = new JobCardApp(); jobCardApp.CardType = _WorkCardID; jobCardApp.DateCreated = DateTime.Now; jobCardApp.DateStarted = Convert.ToDateTime(Request.Form["JobDateFrom"]); jobCardApp.DateEnded = Convert.ToDateTime(Request.Form["JobDateTo"]); jobCardApp.Status = false; jobCardApp.UserID = LoggedInUser.UserID; _EmpNo = Request.Form["JobEmpNo"]; _Emp = emps.Where(aa => aa.EmpNo == _EmpNo).ToList(); if (_Emp.Count > 0) { jobCardApp.CriteriaData = _Emp.FirstOrDefault().EmpID; jobCardApp.JobCardCriteria = "E"; if (ValidateJobCard(jobCardApp)) { db.JobCardApps.Add(jobCardApp); if (db.SaveChanges() > 0) { AddJobCardAppToJobCardData(); Message = "Job Card Created Sucessfully."; } } else Message = "Job Card already created for FPID: " + _EmpNo; } else Message = "No Employee found, Please enter a valid FPID"; //Add Job Card to JobCardData and Mark Legends in Attendance Data if attendance Created Session["EditAttendanceDate"] = DateTime.Today.Date.ToString("yyyy-MM-dd"); ViewData["datef"] = Session["EditAttendanceDate"].ToString(); ViewData["JobDateFrom"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewData["JobDateTo"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName"); } catch (Exception ex) { Message = "An Error occured while creating Job Card of " + Request.Form["JobCardType"].ToString(); } //List<EmpView> emps = new List<EmpView>(); ViewData["JobDateFrom"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewData["JobDateTo"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName"); ViewBag.CMessage = Message; ViewBag.CurrentFilter = ""; int pageSize = 10; int? page = 1; int pageNumber = (page ?? 1); return View("Index",emps.ToPagedList(pageNumber, pageSize)); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DivGridSection.Visible = false; DivGridCrew.Visible = false; DivGridDept.Visible = false; DivGridEmp.Visible = false; DivShiftGrid.Visible = false; DivLocGrid.Visible = false; DivTypeGrid.Visible = false; ReportViewer1.Visible = true; DivGridComapny.Visible = false; SelectedComps.Clear(); ReportViewer1.Width = 1050; ReportViewer1.Height = 700; SelectedTypes.Clear(); SelectedCrews.Clear(); SelectedDepts.Clear(); SelectedEmps.Clear(); SelectedLocs.Clear(); SelectedSections.Clear(); SelectedShifts.Clear(); RefreshLabels(); LoadGridViews(); DateTime date = DateTime.Today.Date.AddDays(-1); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/DRMultipleInOut.rdlc"; } else PathString = "/WMS/Reports/RDLC/DRMultipleInOut.rdlc"; User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable datatable = qb.GetValuesfromDB("select * from ViewDetailAttData " + query + " and (AttDate = " + "'" + date.ToString("yyyy-MM-dd") + "')" + " and (Tin1 is not null or TOut1 is not null)"); List<ViewDetailAttData> _View = datatable.ToList<ViewDetailAttData>(); LoadReport(PathString, _View); } }
protected void btnGenerateReport_Click(object sender, EventArgs e) { RefreshLabels(); DivGridSection.Visible = false; DivGridCrew.Visible = false; DivGridDept.Visible = false; DivGridEmp.Visible = false; DivShiftGrid.Visible = false; DivLocGrid.Visible = false; DivTypeGrid.Visible = false; ReportViewer1.Visible = true; DivGridComapny.Visible = false; List<EmpView> _TempViewList = new List<EmpView>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query); List<EmpView> _ViewList = dt.ToList<EmpView>(); if (SelectedEmps.Count > 0) { foreach (var emp in SelectedEmps) { _TempViewList.AddRange(_ViewList.Where(aa => aa.EmpID == emp.EmpID).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for department if (SelectedDepts.Count > 0) { foreach (var dept in SelectedDepts) { _TempViewList.AddRange(_ViewList.Where(aa => aa.DeptName == dept.DeptName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for sections if (SelectedSections.Count > 0) { foreach (var sec in SelectedSections) { _TempViewList.AddRange(_ViewList.Where(aa => aa.SectionName == sec.SectionName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for company if (SelectedComps.Count > 0) { foreach (var comp in SelectedComps) { _TempViewList.AddRange(_ViewList.Where(aa => aa.CompName == comp.CompName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for crews if (SelectedCrews.Count > 0) { foreach (var cre in SelectedCrews) { _TempViewList.AddRange(_ViewList.Where(aa => aa.CrewName == cre.CrewName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for location if (SelectedLocs.Count > 0) { foreach (var loc in SelectedLocs) { _TempViewList.AddRange(_ViewList.Where(aa => aa.LocName == loc.LocName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for shifts if (SelectedShifts.Count > 0) { foreach (var shift in SelectedShifts) { _TempViewList.AddRange(_ViewList.Where(aa => aa.ShiftName == shift.ShiftName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); //for category if (SelectedTypes.Count > 0) { foreach (var cat in SelectedTypes) { _TempViewList.AddRange(_ViewList.Where(aa => aa.TypeName == cat.TypeName).ToList()); } _ViewList = _TempViewList.ToList(); } else _TempViewList = _ViewList.ToList(); _TempViewList.Clear(); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/EmployeeDetail.rdlc"; } else PathString = "/WMS/Reports/RDLC/EmployeeDetail.rdlc"; LoadReport(PathString, _ViewList); }
// GET: /LvApp/ public ActionResult Index(string sortOrder, string searchString, string currentFilter, int? page) { ViewBag.CurrentSort = sortOrder; ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.TypeSortParm = sortOrder == "LvType" ? "LvType_desc" : "LvType"; ViewBag.DateSortParm = sortOrder == "Date" ? "Date_desc" : "Date"; if (searchString != null) { page = 1; } else { searchString = currentFilter; } User LoggedInUser = Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DateTime dt1 = DateTime.Today; DateTime dt2 = new DateTime(dt1.Year, 1, 1); string date = dt2.Year.ToString()+"-"+dt2.Month.ToString()+"-"+dt2.Day.ToString()+" "; DataTable dt = qb.GetValuesfromDB("select * from ViewLvApplication " + query + " and (ToDate >= '" + date + "')"); List<ViewLvApplication> lvapplications = dt.ToList<ViewLvApplication>(); ViewBag.CurrentFilter = searchString; //var lvapplications = db.LvApplications.Where(aa=>aa.ToDate>=dt2).Include(l => l.Emp).Include(l => l.LvType1); if (!String.IsNullOrEmpty(searchString)) { lvapplications = lvapplications.Where(s => s.EmpName.ToUpper().Contains(searchString.ToUpper()) || s.EmpNo.ToUpper().Contains(searchString.ToUpper())).ToList(); } switch (sortOrder) { case "name_desc": lvapplications = lvapplications.OrderByDescending(s => s.EmpName).ToList(); break; case "LvType_desc": lvapplications = lvapplications.OrderByDescending(s => s.LvType).ToList(); break; case "LvType": lvapplications = lvapplications.OrderBy(s => s.LvType).ToList(); break; case "Date_desc": lvapplications = lvapplications.OrderByDescending(s => s.LvDate).ToList(); break; case "Date": lvapplications = lvapplications.OrderBy(s => s.LvDate).ToList(); break; default: lvapplications = lvapplications.OrderBy(s => s.EmpName).ToList(); break; } int pageSize = 8; int pageNumber = (page ?? 1); return View(lvapplications.OrderBy(aa=>aa.LvDate).ToPagedList(pageNumber, pageSize)); }
public ActionResult EditAttJobCard() { User LoggedInUser = Session["LoggedUser"] as User; string Message = ""; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query); List<EmpView> emps = dt.ToList<EmpView>(); try { string _EmpNo = ""; // int CompID = Convert.ToInt16(Request.Form["CompanyID"].ToString()); List<EmpView> _Emp = new List<EmpView>(); short _WorkCardID = Convert.ToInt16(Request.Form["JobCardType"].ToString()); //First Save Job Card Application JobCardTime jobCardTime = new JobCardTime(); jobCardTime.JobCardID = _WorkCardID; jobCardTime.CreatedDate = DateTime.Now; jobCardTime.DutyDate = Convert.ToDateTime(Request.Form["JobDate"]); string STime = Request.Form["SHour"].ToString(); string ETime = Request.Form["EHour"].ToString(); string STimeH = STime.Substring(0, 2); string STimeM = STime.Substring(2, 2); string ETimeH = ETime.Substring(0, 2); string ETimeM = ETime.Substring(2, 2); jobCardTime.CreatedBy = LoggedInUser.UserID; jobCardTime.AssignedBy = Convert.ToInt16(Request.Form["JobCardDesignation"].ToString()); jobCardTime.StartTime = new TimeSpan(Convert.ToInt32(STimeH), Convert.ToInt32(STimeM), 0); jobCardTime.EndTime = new TimeSpan(Convert.ToInt32(ETimeH), Convert.ToInt32(ETimeM), 0); jobCardTime.TTime = (jobCardTime.EndTime - jobCardTime.StartTime); //jobCardTime.StartTime = Convert.toti(Request.Form["SHour"]); //jobCardTime.EndTime = Convert.ToDateTime(Request.Form["EHour"]); string Remakrs = Request.Form["Remakrs"].ToString(); if (Remakrs != "") jobCardTime.Remarks = Remakrs; jobCardTime.CreatedBy = LoggedInUser.UserID; _EmpNo = Request.Form["JobEmpNo"]; _Emp = emps.Where(aa => aa.EmpNo == _EmpNo).ToList(); if (_Emp.Count > 0) { jobCardTime.EmpID = _Emp.FirstOrDefault().EmpID; //if ((jobCardTime.EndTime - jobCardTime.StartTime).TotalMinutes > 0) //{ if (ValidateJobCard(jobCardTime)) { db.JobCardTimes.Add(jobCardTime); if (db.SaveChanges() > 0) { AddJobCardTimeInAttData(jobCardTime); Message = "Job Card Created Sucessfully"; } else Message = "Job Card is not created due to server error"; } else Message = "Job Card already created for FPID: " + _EmpNo; //} } else Message = "No Employee found, Please enter a valid FPID"; //Add Job Card to JobCardData and Mark Legends in Attendance Data if attendance Created Session["EditAttendanceDate"] = DateTime.Today.Date.ToString("yyyy-MM-dd"); ViewData["datef"] = Session["EditAttendanceDate"].ToString(); ViewData["JobDate"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName"); ViewBag.JobCardDesignation = new SelectList(db.Designations, "DesignationID", "DesignationName"); } catch (Exception ex) { Message = "An Error occured while creating Job Card of " + Request.Form["JobCardType"].ToString(); } //List<EmpView> emps = new List<EmpView>(); ViewData["JobDate"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); ViewBag.JobCardType = new SelectList(db.JobCards, "WorkCardID", "WorkCardName"); ViewBag.JobCardDesignation = new SelectList(db.Designations, "DesignationID", "DesignationName"); ViewBag.CMessage = Message; ViewBag.CurrentFilter = ""; int pageSize = 10; int? page = 1; int pageNumber = (page ?? 1); return View("Index", emps.ToPagedList(pageNumber, pageSize)); }
protected void Page_Load(object sender, EventArgs e) { String reportName = Request.QueryString["reportname"]; if (!Page.IsPostBack) { List<string> list = Session["ReportSession"] as List<string>; FiltersModel fm = Session["FiltersModel"] as FiltersModel; CreateDataTable(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); _dateFrom = list[0]; string _dateTo = list[1]; string PathString = ""; switch (reportName) { case "emp_record": DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query); List<EmpView> _ViewList = dt.ToList<EmpView>(); List<EmpView> _TempViewList = new List<EmpView>(); title = "Employee Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/Employee.rdlc"; else PathString = "/WMS/Reports/RDLC/Employee.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm,_TempViewList, _ViewList) , _dateFrom+" TO "+_dateTo); break; case "emp_detail_excel": DataTable dt1 = qb.GetValuesfromDB("select * from EmpView " + query); List<EmpView> _ViewList1 = dt1.ToList<EmpView>(); List<EmpView> _TempViewList1 = new List<EmpView>(); title = "Employee Detail Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/EmployeeDetail.rdlc"; else PathString = "/WMS/Reports/RDLC/EmployeeDetail.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList1, _ViewList1), _dateFrom + " TO " + _dateTo); break; case "leave_application": dt1 = qb.GetValuesfromDB("select * from ViewLvApplication " + query + " and (FromDate >= '" + _dateFrom + "' and ToDate <= '" + _dateTo + "' )"); List<ViewLvApplication> _ViewListLvApp = dt1.ToList<ViewLvApplication>(); List<ViewLvApplication> _TempViewListLvApp = new List<ViewLvApplication>(); title = "Leave Application Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRLeave.rdlc"; else PathString = "/WMS/Reports/RDLC/EmployeeDetail.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListLvApp, _ViewListLvApp), _dateFrom + " TO " + _dateTo); break; case "detailed_att": DataTable dt2 = qb.GetValuesfromDB("select * from ViewDetailAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); List<ViewDetailAttData> _ViewList2 = dt2.ToList<ViewDetailAttData>(); List<ViewDetailAttData> _TempViewList2 = new List<ViewDetailAttData>(); title = "Detailed Attendence"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRdetailed.rdlc"; else PathString = "/WMS/Reports/RDLC/DRdetailed.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList2, _ViewList2), _dateFrom + " TO " + _dateTo); break; case "consolidated_att": DataTable dt3 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" ); List<ViewAttData> _ViewList3 = dt3.ToList<ViewAttData>(); List<ViewAttData> _TempViewList3 = new List<ViewAttData>(); title = "Consolidated Attendence"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRAttendance.rdlc"; else PathString = "/WMS/Reports/RDLC/DRAttendance.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList3, _ViewList3), _dateFrom + " TO " + _dateTo); break; case "present": DataTable dt4 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusP = 1 "); List<ViewAttData> _ViewList4 = dt4.ToList<ViewAttData>(); List<ViewAttData> _TempViewList4 = new List<ViewAttData>(); title = "Present Employee Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRPresent.rdlc"; else PathString = "/WMS/Reports/RDLC/DRPresent.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList4, _ViewList4), _dateFrom + " TO " + _dateTo); break; case "absent": DataTable dt5 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" +" and StatusAB = 1 "); List<ViewAttData> _ViewList5 = dt5.ToList<ViewAttData>(); List<ViewAttData> _TempViewList5 = new List<ViewAttData>(); title = "Absent Employee Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRAbsent.rdlc"; else PathString = "/WMS/Reports/RDLC/DRAbsent.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList5, _ViewList5), _dateFrom + " TO " + _dateTo); break; case "lv_application": DataTable dt6 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and (StatusLeave=1 OR StatusHL=1)"); List<ViewAttData> _ViewList6 = dt6.ToList<ViewAttData>(); List<ViewAttData> _TempViewList6 = new List<ViewAttData>(); title = "Leave Attendence Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRAbsent.rdlc"; else PathString = "/WMS/Reports/RDLC/DRAbsent.rdlc"; //LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList6, _ViewList6), _dateFrom + " TO " + _dateTo); //To-do Develop Leave Attendance Report break; case "short_lv": DataTable dt7 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusSL=1"); List<ViewAttData> _ViewList7 = dt7.ToList<ViewAttData>(); List<ViewAttData> _TempViewList7 = new List<ViewAttData>(); title = "Short Leave Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRShortLeave.rdlc"; else PathString = "/WMS/Reports/RDLC/DRShortLeave.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList7, _ViewList7), _dateFrom + " TO " + _dateTo); break; case "late_in": DataTable dt8 = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusLI=1 "); List<ViewAttData> _ViewList8 = dt8.ToList<ViewAttData>(); List<ViewAttData> _TempViewList8 = new List<ViewAttData>(); title = "Late In Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRLateIn.rdlc"; else PathString = "/WMS/Reports/RDLC/DRLateIn.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "late_out": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusLO=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Late Out Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRLateOut.rdlc"; else PathString = "/WMS/Reports/RDLC/DRLateOut.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "early_in": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusEI=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Early In Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DREarlyIn.rdlc"; else PathString = "/WMS/Reports/RDLC/DREarlyIn.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "early_out": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusEO=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Early Out Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DREarlyOut.rdlc"; else PathString = "/WMS/Reports/RDLC/DREarlyOut.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "overtime": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusOT=1 "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "OverTime Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DROverTime.rdlc"; else PathString = "/WMS/Reports/RDLC/DROverTime.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "missing_attendance": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and ((TimeIn is null and TimeOut is not null) or (TimeIn is not null and TimeOut is null)) "); _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); title = "Missing Attendence"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRMissingAtt.rdlc"; else PathString = "/WMS/Reports/RDLC/DRMissingAtt.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "multiple_in_out": dt = qb.GetValuesfromDB("select * from ViewMultipleInOut " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and (Tin1 is not null or TOut1 is not null)"); //change query for multiple_in_out List<ViewMultipleInOut> _ViewList9 = dt.ToList<ViewMultipleInOut>(); List<ViewMultipleInOut> _TempViewList9 = new List<ViewMultipleInOut>(); title = "Multiple In/Out Report"; if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/DRMultipleInOut.rdlc"; else PathString = "/WMS/Reports/RDLC/DRMultipleInOut.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList9, _ViewList9), _dateFrom + " TO " + _dateTo); break; case "monthly_leave_sheet": string _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from EmpView " + query); title = "Monthly Leave Sheet for Permanent Employees"; _ViewList1 = dt.ToList<EmpView>(); _TempViewList1 = new List<EmpView>(); if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MLvConsumed.rdlc"; else PathString = "/WMS/Reports/RDLC/MLvConsumed.rdlc"; int month = Convert.ToDateTime(_dateFrom).Month; LoadReport(PathString,GetLV(ReportsFilterImplementation(fm, _TempViewList1, _ViewList1) ,2),month); // LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList1, _ViewList1), _dateFrom); break; case "monthly_21-20": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Sheet for Permanent Employees(21st to 20th)"; List<ViewMonthlyDataPer> _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); List<ViewMonthlyDataPer> _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSheetP.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSheetP.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "monthly_1-31": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Period = " + _period); title = "Monthly Sheet for Permanent Employees(1st to 31st)"; List<ViewMonthlyData> _ViewListMonthlyData = dt.ToList<ViewMonthlyData>(); List<ViewMonthlyData> _TempViewListMonthlyData = new List<ViewMonthlyData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSheetC.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSheetC.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyData, _ViewListMonthlyData), _dateFrom); break; case "monthlysummary_21-20": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Summary for Permanent Employees(21st to 20th)"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "monthlysummary_1-31": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Summary for Permanent Employees(1st to 31st)"; _ViewListMonthlyData = dt.ToList<ViewMonthlyData>(); _TempViewListMonthlyData = new List<ViewMonthlyData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSummaryC.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSummaryC.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyData, _ViewListMonthlyData), _dateFrom); break; case "monthly_21-20_excel": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Sheet for Permanent Employees(21st to 20th)"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRDetailExcelP.rdlc"; else PathString = "/WMS/Reports/RDLC/MRDetailExcelP.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "monthly_1-31_consolidated": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyData " + query + " and Period = " + _period); title = "Monthly Consolidated (1st to 31th)"; List<ViewMonthlyData> VMLD =new List<ViewMonthlyData>(); VMLD = dt.ToList<ViewMonthlyData>(); _TempViewListMonthlyData = new List<ViewMonthlyData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRDetailExcelC.rdlc"; else PathString = "/WMS/Reports/RDLC/MRDetailExcelC.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyData, VMLD), _dateFrom); break; case "monthly_21-20_consolidated": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewMonthlyDataPer " + query + " and Period = " + _period); title = "Monthly Consolidated (21th to 20th)(Excel)"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRDetailExcelP.rdlc"; else PathString = "/WMS/Reports/RDLC/MRDetailExcelP.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "emp_att": dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )"); title = "Employee Attendance"; _ViewList8 = dt.ToList<ViewAttData>(); _TempViewList8 = new List<ViewAttData>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/EmpAttSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/EmpAttSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewList8, _ViewList8), _dateFrom + " TO " + _dateTo); break; case "emp_absent": _period = Convert.ToDateTime(_dateFrom).Month.ToString() + Convert.ToDateTime(_dateFrom).Year.ToString(); dt = qb.GetValuesfromDB("select * from ViewAttData " + query + " and (AttDate >= " + "'" + _dateFrom + "'" + " and AttDate <= " + "'" + _dateTo + "'" + " )" + " and StatusAB = 1 "); title = "Employee Absent"; _ViewListMonthlyDataPer = dt.ToList<ViewMonthlyDataPer>(); _TempViewListMonthlyDataPer = new List<ViewMonthlyDataPer>(); //Change the Paths if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MRSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/MRSummary.rdlc"; LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; case "lv_quota": dt = qb.GetValuesfromDB("select * from EmpView " + query); _ViewList1 = dt.ToList<EmpView>(); _TempViewList1 = new List<EmpView>(); if (GlobalVariables.DeploymentType == false) PathString = "/Reports/RDLC/MYLeaveSummary.rdlc"; else PathString = "/WMS/Reports/RDLC/MYLeaveSummary.rdlc"; LoadReport(PathString, GYL(ReportsFilterImplementation(fm, _TempViewList1, _ViewList1))); // LoadReport(PathString, ReportsFilterImplementation(fm, _TempViewListMonthlyDataPer, _ViewListMonthlyDataPer), _dateFrom); break; } } }
private void LoadEmpGrid(User _loggedUser) { QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(_loggedUser); DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query + " and (Status=1)"); List<EmpView> _View = dt.ToList<EmpView>(); grid_Employee.DataSource = _View; grid_Employee.DataBind(); }
protected void btnGenerateReport_Click(object sender, EventArgs e) { ReportViewer1.Visible = true; //List<ViewMultipleInOut> _ViewList = new List<ViewMultipleInOut>(); List<ViewMultipleInOut> _TempViewList = new List<ViewMultipleInOut>(); User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User; QueryBuilder qb = new QueryBuilder(); string query = qb.MakeCustomizeQuery(LoggedInUser); string _dateTo = "'"+DateTo.Date.Year.ToString() + "-" + DateTo.Date.Month.ToString() + "-" + DateTo.Date.Day.ToString()+"'"; string _dateFrom = "'" + DateFrom.Date.Year.ToString() + "-" + DateFrom.Date.Month.ToString() + "-" + DateFrom.Date.Day.ToString() + "'"; DataTable dt = qb.GetValuesfromDB("select * from ViewMultipleInOut " + query + " and (AttDate >= "+_dateFrom+" and AttDate <= "+_dateTo+" )" ); List<ViewMultipleInOut> _ViewList = dt.ToList<ViewMultipleInOut>(); if (GlobalVariables.DeploymentType == false) { PathString = "/Reports/RDLC/DRDetailed.rdlc"; } else PathString = "/WMS/Reports/RDLC/DRDetailed.rdlc"; LoadReport(PathString, _ViewList); }