public DisbursementController(RequestServices rs, RequestDetailService rds, DisbursementService ds, Emailservice ems)
 {
     this.rs  = rs;
     this.rds = rds;
     this.ds  = ds;
     this.ems = ems;
 }
 public RequestAPIController(InventoryService inventService, RequestDetailService requestDetailservice, RequestServices requestService, Emailservice emailservice)
 {
     this.inventService        = inventService;
     this.requestDetailservice = requestDetailservice;
     this.requestService       = requestService;
     this.emailservice         = emailservice;
 }
Example #3
0
 public IActionResult ConfirmDelegation([FromServices] EmployeeService es, [FromServices] Emailservice ems, int employeeId, DateTime startDate, DateTime endDate)
 {
     if (!(HttpContext.Session.GetString("role") == EmployeeRole.DEPTHEAD))
     {
         return(RedirectToAction(HttpContext.Session.GetString("role"), "Home"));
     }
     //check dates
     if (endDate < startDate)
     {
         TempData["errmsg"] = "End Date cannot be before Start Date.";
         return(RedirectToAction("Delegate"));
     }
     if (startDate < DateTime.Today)
     {
         TempData["errmsg"] = "Invalid date input. Ensure both Start Date and End Date are selected and Start Date should be today or later.";
         return(RedirectToAction("Delegate"));
     }
     if (es.OverlappingAppointment(employeeId, startDate, endDate))
     {
         TempData["errmsg"] = "An employee has already been appointed as the Acting Dept Head for the period.";
         return(RedirectToAction("Delegate"));
     }
     es.AddActingDepartmentHead(employeeId, startDate, endDate);
     ems.sendDelegateAppointmentEmail(employeeId, startDate, endDate);
     return(RedirectToAction("DepartmentHead", "Home"));
 }
 public DepartmentRepController(EmployeeService es, DepartmentService ds, CollectionPointService cps, Emailservice ems)
 {
     this.ds  = ds;
     this.es  = es;
     this.cps = cps;
     this.ems = ems;
 }
 public RequestController(ILogger <RequestController> logger, RequestServices requestService, RequestDetailService requestDetailService, InventoryService inventoryItemService, Emailservice emailService, ADProjContext dbcontext)
 {
     _logger                   = logger;
     this.requestService       = requestService;
     this.requestDetailService = requestDetailService;
     this.inventoryItemService = inventoryItemService;
     this.emailService         = emailService;
     this.dbcontext            = dbcontext;
 }
Example #6
0
 public IActionResult CancelDelegation([FromServices] EmployeeService es, [FromServices] Emailservice ems, int id)
 {
     if (!(HttpContext.Session.GetString("role") == EmployeeRole.DEPTHEAD))
     {
         return(RedirectToAction(HttpContext.Session.GetString("role"), "Home"));
     }
     es.DeleteActingDepartmentHead(id);
     ems.sendDelegateCancellationEmail(id);
     return(RedirectToAction("DepartmentHead", "Home"));
 }
Example #7
0
 public DepartmentHeadController(EmployeeService es, DepartmentService ds, Emailservice ems)
 {
     this.ds  = ds;
     this.es  = es;
     this.ems = ems;
 }