public async Task <IActionResult> AttendenceInfo(DateTime Month) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; int EmpId = Currentuser.EmpId; ViewBag.P = _attendenceRepo.PresentCount(Currentuser.EmpId); // ViewBag.A = _attendenceRepo.AbsentCount(Currentuser.EmpId); ViewBag.L = _attendenceRepo.LeaveCount(Currentuser.EmpId); ViewBag.W = _attendenceRepo.HoursCount(Currentuser.EmpId); ViewBag.IO = _attendenceRepo.InOutCount(Currentuser.EmpId); String monthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Month.Month); if (Month != DateTime.MinValue) { ViewBag.Month = Month; ViewBag.subtitle = "Attendence of " + monthName + " , " + Month.Year; var data = await _attendenceRepo.GetAttInfo(EmpId, Month); if (data == null) { ViewBag.a = DateTime.MinValue; return(RedirectToAction(nameof(AttendenceInfo))); } else { ViewBag.a = Month; return(View(data)); } } ViewBag.a = Month; return(View()); }
public async Task <IActionResult> TimeSheet(int id, DateTime Start, DateTime End, String Complete, int ID = 0) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; ViewBag.EmpId = Currentuser.EmpId; ViewBag.TaskId = ID; if (ID != 0) { await _taskRepository.AddTaskFromList(ID); } if (Start != DateTime.MinValue && End != DateTime.MinValue) { await _taskRepository.TImeSheetTaskInsert(id, Start, End); await _taskRepository.StatusUpdate(ViewBag.EmpId, Start); await _Repository2.AddCost(id, Start, End); if (Complete == "Complete") { await _taskRepository.CompleteTask(id); } if (Complete == "NotComplete") { await _taskRepository.NotCompleteTask(id); } return(RedirectToAction(nameof(TimeSheet), new { ID = 0 })); } var data = await _taskRepository.AddTaskList(ViewBag.EmpId); return(View(data)); }
public async Task <IActionResult> EmpIndex() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; ViewBag.Rcount = _leaveRepository.leaveRecomCount(); ViewBag.Acount = _leaveRepository.leaveAppCount(); ViewBag.Attcount = _attendenceRepository.AttendenceCount(); ViewBag.Taskcount = _taskRepository.TaskRecomendCount(); return(View()); }
public async Task <IActionResult> StaffDash() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; int id = Currentuser.EmpId; ViewBag.Id = id; var data = await _taskRepository.GetTaskListAsync(id); return(View(data)); }
public async Task <IViewComponentResult> InvokeAsync(string user) { var Currentuser = await _taskRepo.GetCurrentUser(user); int EmpId = Currentuser.EmpId; var data = await _taskRepo.GetTasksForWorkQuality(EmpId); return(View(data)); }
public async Task <IActionResult> Index() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); int id = Currentuser.EmpId; var data = await _taskRepository.GetAllTaskList2(id); return(View(data)); }
public async Task <IActionResult> ReviewDash() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); int id = Currentuser.EmpId; var data = await _taskRepository.GetAllTaskList2(id); double quality = 0; foreach (var task in data) { quality += ((task.AllocatedHours - task.TakenHours) / task.AllocatedHours) * 100; } Double dc = Math.Round((Double)quality, 0); ViewBag.qulity = dc; // efficiency int count = _taskRepository.GetWorkQualityCount(id); if (count != 0) { Double WorkQ = _taskRepository.GetWorkQualitySum(id) / count; Double Work = Math.Round((Double)WorkQ, 0); ViewBag.Workqulity = Work; // work quality } else { ViewBag.Workqulity = 0; } int count1 = _taskRepository.GetCommunicationCount(id); if (count1 != 0) { Double ComQ = _taskRepository.GetComSum(id) / count1; Double com = Math.Round((Double)ComQ, 0); ViewBag.Communication = com; // work quality } else { ViewBag.Communication = 0; } return(View()); }
public async Task <IActionResult> Communication(bool isSucceess = false, int id = 0, int Val = 0) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); int EmpId = Currentuser.EmpId; ViewBag.Emps = new SelectList(await _taskRepository.GetEmps(EmpId), "EmpId", "EmpFullName"); if (id != 0) { int ComId = await _taskRepository.AddValForCommunication(id, Val, EmpId); if (ComId > 0) { return(RedirectToAction(nameof(Communication), new { isSucceess = true })); } } ViewBag.IsSuccess = isSucceess; return(View()); }
public async Task <IActionResult> Index(bool isSucceess = false, bool isExist = false, int id = 0, int TaskId = 0, int Val = 0) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); int EmpId = Currentuser.EmpId; ViewBag.Emps = new SelectList(await _taskRepository.GetEmps(EmpId), "EmpId", "EmpFullName"); if (id != 0) { ViewBag.Show = true; ViewBag.Id = id; ViewBag.Name = await _taskRepository.GetName(id); ViewBag.Task = new SelectList(await _taskRepository.GetTask(id), "Id", "Name"); } if (TaskId != 0) { bool result = _taskRepository.CheckRate(TaskId, id, EmpId); if (result == true) { return(RedirectToAction(nameof(Index), new { isExist = true })); } else { int WorkId = await _taskRepository.AddVal(TaskId, id, Val, EmpId); if (WorkId > 0) { return(RedirectToAction(nameof(Index), new { isSucceess = true })); } } } ViewBag.IsSuccess = isSucceess; ViewBag.IsExist = isExist; return(View()); }
public async Task <IActionResult> Leavebalance() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; int EmpId = Currentuser.EmpId; var data = await _leaveRepository.GetLeaveBalance(EmpId); return(View(data)); }