public async Task<ActionResult> ComplainDashboard() { try { if (_UtilitySession.Session != null) { ViewBag.Name = _UtilitySession.Session.user.name; string User_id = _UtilitySession.Session.user.id; LabourComplaintDetailDTO _LabourComplaintDetailDTO = new LabourComplaintDetailDTO(); _LabourComplaintDetailDTO.user = _UtilitySession.Session.user; _LabourComplaintDetailDTO._TimesheetComGridPostDTO = await Task.Run(() => _Repository.getComplaintDashboard(DateTime.Now.AddDays(-10), DateTime.Now, "")); _LabourComplaintDetailDTO.PageSize = 5; _LabourComplaintDetailDTO.TotalCount = _LabourComplaintDetailDTO._TimesheetComGridPostDTO.Count; return View(_LabourComplaintDetailDTO); } else { return RedirectToAction("Index", "Home"); } } catch (Exception e) { ViewBag.Error = e.ToString(); return View(); } }
public async Task <ActionResult> Complaint(TimesheetComPostDTO _TimesheetComPostDTO) { try { if (_UtilitySession.Session != null) { LabourComplaintDetailDTO _LabourComplaintDetailDTO = new LabourComplaintDetailDTO(); List <TimesheetComGridPostDTO> _TimesheetComGridPostDTO = new List <TimesheetComGridPostDTO>(); ViewBag.Name = _UtilitySession.Session.user.name; string User_id = _UtilitySession.Session.user.id; List <ts_timesheet> _ts_timesheet_com = new List <ts_timesheet>(); ts_user _ts_user = new ts_user(); _ts_user = _UtilitySession.Session.user; _TimesheetComGridPostDTO = await Task.Run(() => _Repository.setTimesheetComData(_TimesheetComPostDTO, _ts_user)); _LabourComplaintDetailDTO._TimesheetComGridPostDTO = _TimesheetComGridPostDTO; return(View(_LabourComplaintDetailDTO)); } else { return(RedirectToAction("Index", "Home")); } } catch (NullReferenceException e) { ViewBag.Error = e.ToString(); return(View()); } }
public async Task <ActionResult> Complaint() { try { if (_UtilitySession.Session != null) { TimesheetEntities _TimesheetEntities = new TimesheetEntities(); ViewBag.Name = _UtilitySession.Session.user.name; string User_id = _UtilitySession.Session.user.id; LabourComplaintDetailDTO _LabourComplaintDetailDTO = new LabourComplaintDetailDTO(); _LabourComplaintDetailDTO.user = _UtilitySession.Session.user; _LabourComplaintDetailDTO._TimesheetComGridPostDTO = await Task.Run(() => _Repository.getComplaintTimesheetData(User_id)); _LabourComplaintDetailDTO.PageSize = 5; _LabourComplaintDetailDTO.TotalCount = _LabourComplaintDetailDTO._TimesheetComGridPostDTO.Count; return(View(_LabourComplaintDetailDTO)); } else { return(RedirectToAction("Index", "Home")); } } catch (Exception e) { ViewBag.Error = e.ToString(); return(View()); } }
public async Task <ActionResult> AllCheckOut(string CheckoutTime) { LabourComplaintDetailDTO _LabourComplaintDetailDTO = new LabourComplaintDetailDTO(); if (_UtilitySession.Session != null) { ViewBag.Name = _UtilitySession.Session.user.name; List <TimesheetComGridPostDTO> _TimesheetComGridPostDTO = new List <TimesheetComGridPostDTO>(); _UtilitySession.Session._TimesheetGridDTO = null; ts_user _ts_user = new ts_user(); _ts_user = _UtilitySession.Session.user; _TimesheetComGridPostDTO = await Task.Run(() => _Repository.AllComplainCheckOut(_ts_user, CheckoutTime)); _UtilityComplainSession.Session._TimesheetComGridPostDTO = _TimesheetComGridPostDTO; _LabourComplaintDetailDTO._TimesheetComGridPostDTO = _TimesheetComGridPostDTO; _LabourComplaintDetailDTO._TimesheetComGridPostDTO = _UtilityComplainSession.Session._TimesheetComGridPostDTO; _LabourComplaintDetailDTO.PageSize = 5; _LabourComplaintDetailDTO.TotalCount = _UtilitySession.Session._TimesheetGridDTO.Count; return(View(_LabourComplaintDetailDTO)); } else { return(RedirectToAction("Index", "Home")); } }
public async Task <ActionResult> IndividualCheckOut(int?empid, string checkOutTime) { LabourComplaintDetailDTO _LabourComplaintDetailDTO = new LabourComplaintDetailDTO(); if (_UtilitySession.Session != null) { ViewBag.Name = _UtilitySession.Session.user.name; List <TimesheetComGridPostDTO> _TimesheetComGridPostDTO = new List <TimesheetComGridPostDTO>(); ts_user _ts_user = new ts_user(); _ts_user = _UtilitySession.Session.user; _TimesheetComGridPostDTO = await Task.Run(() => _Repository.IndividualComplainCheckOut(_ts_user, empid, checkOutTime)); return(View(_LabourComplaintDetailDTO)); } else { return(RedirectToAction("Index", "Home")); } }
public async Task<ActionResult> GridViewComplainDashboard(string datepicker, string datepicker2, string com_no) { DashboardDTO _DashboardDTO = new DashboardDTO(); List<DashboardGridDTO> _DashboardGridDTO = new List<DashboardGridDTO>(); LabourComplaintDetailDTO _LabourComplaintDetailDTO = new LabourComplaintDetailDTO(); if (_UtilitySession.Session != null) { if (_UtilitySession.Session.Status == true) { try { DateTime _fromdate = DateTime.ParseExact(datepicker.ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime _todate = DateTime.ParseExact(datepicker2, "dd/MM/yyyy", CultureInfo.InvariantCulture); ViewBag.Name = _UtilitySession.Session.user.name; string User_id = _UtilitySession.Session.user.id; _LabourComplaintDetailDTO.user = _UtilitySession.Session.user; _LabourComplaintDetailDTO._TimesheetComGridPostDTO = await Task.Run(() => _Repository.DashboardComplainForProjectEngineers(_fromdate, _todate, com_no)); _LabourComplaintDetailDTO.PageSize = 5; _LabourComplaintDetailDTO.TotalCount = _LabourComplaintDetailDTO._TimesheetComGridPostDTO.Count; } catch (Exception ex) { throw; } return PartialView("_PartialViewGridComplainDashboard", _LabourComplaintDetailDTO); } else { return RedirectToAction("Detail", "Home"); } } else { return RedirectToAction("Detail", "Home"); } }