RequisitionDetailsDTO IRequisitionCatalogueService.GetRequisitionDetailsForSingleRequisition(int requisitionId, int employeeId)
        {
            string      employeeName = employeeRepo.FindById(employeeId).Name;
            Requisition requisition  = requisitionRepo.FindById(requisitionId);
            List <RequisitionDetail> requisitionDetails = requisitionDetailRepo.RequisitionDetailsEagerLoadStationery(requisitionId);

            return(new RequisitionDetailsDTO()
            {
                EmployeeName = employeeName,
                RequestedDate = requisition.DateTime.ToString("yyyy-MM-dd"),
                RequisitionFormId = requisition.Id,
                RequisitionStatus = requisition.Status,
                Remarks = requisition.Remarks,
                RequisitionDetails = requisitionDetails,
                Requisition = requisition,
            });
        }
예제 #2
0
        public ActionResult Index()
        {
            //for testing
            Employee    e = employeeRepo.FindById(2);
            Requisition r = reqRepo.FindById(25);

            return(View());
        }
        public void ApproveRejectPendingRequisition(int requisitionId, string action, string remarks)
        {
            Requisition r = requisitionRepo.FindById(requisitionId);

            if (remarks != null)
            {
                r.Remarks = remarks;
            }

            if (action.Equals("approve"))
            {
                r.Status = RequisitionStatusEnum.APPROVED.ToString();
                requisitionRepo.Update(r);
                CascadeToRequisitionDetails(action, requisitionId);
            }
            else
            {
                r.Status = RequisitionStatusEnum.REJECTED.ToString();
                requisitionRepo.Update(r);
                CascadeToRequisitionDetails(action, requisitionId);
            }
            emailNotificationService.NotifyEmployeeApprovedOrRejectedRequisition(r, r.Employee);
        }