Exemple #1
0
        // GET: Requisitions/Details/5
        public ActionResult Details(int?id)
        {
            try
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                //ViewBag.Data = _assignRequisitionManager.GetAll().FirstOrDefault(c => c.RequisitionId == id);

                RequisitionStatus requisition = _requisitionStatusManager.FindByRequisitionId((int)id);
                if (requisition.StatusType != "New")
                {
                    ViewBag.Data = _assignRequisitionManager.GetAll().FirstOrDefault(c => c.RequisitionId == id);
                }
                if (requisition == null)
                {
                    return(HttpNotFound());
                }
                RequisitionStatusViewModel requisitionStatusViewModel = Mapper.Map <RequisitionStatusViewModel>(requisition);
                return(View(requisitionStatusViewModel));
            }
            catch (Exception ex)
            {
                return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Details")));
            }
        }
 // GET: AssignRequisitions
 public ActionResult Index(string searchText)
 {
     try
     {
         ICollection <AssignRequisition>          requisitions = _assignRequisitionManager.GetAll();
         IEnumerable <AssignRequisitionViewModel> assignRequisitionViewModels =
             Mapper.Map <IEnumerable <AssignRequisitionViewModel> >(requisitions);
         return(View(assignRequisitionViewModels));
     }
     catch (Exception ex)
     {
         return(View("Error", new HandleErrorInfo(ex, "AssignRequisitions", "Index")));
     }
 }
Exemple #3
0
        // GET: Requisitions/Details/5
        public ActionResult Details(int?id)
        {
            try
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                //ViewBag.Data = _assignRequisitionManager.GetAll().FirstOrDefault(c => c.RequisitionId == id);

                RequisitionStatus requisition = _requisitionStatusManager.FindByRequisitionId((int)id);

                if (requisition == null)
                {
                    return(HttpNotFound());
                }

                if (requisition.StatusType != "New")
                {
                    ViewBag.Data = _assignRequisitionManager.GetAll().FirstOrDefault(c => c.RequisitionId == id);

                    if (requisition.StatusType == "Cancelled")
                    {
                        ViewBag.CancelInfo = _cancelRequisitionManager.GetAll().FirstOrDefault(c => c.RequisitionId == id);
                    }
                }

                //Employee notification status updated.
                Notification notificationUpdate = _notificationManager.FindByRequisitionId(requisition.RequisitionId);
                if (notificationUpdate != null)
                {
                    notificationUpdate.SenderViewStatus = "Seen";
                    _notificationManager.Update(notificationUpdate);
                }


                RequisitionStatusViewModel requisitionStatusViewModel = Mapper.Map <RequisitionStatusViewModel>(requisition);

                return(View(requisitionStatusViewModel));
            }
            catch (Exception ex)
            {
                ExceptionMessage(ex);
                return(View("Error", new HandleErrorInfo(ex, "Requisitions", "Details")));
            }
        }