Ejemplo n.º 1
0
        public ActionResult AllocateReviewer(string reviewer, int documentId, string permissionType)
        {
            DocumentsOperations dops = new DocumentsOperations();

            try
            {
                if (permissionType == "Add")
                {
                    dops.AllocateReviewerToDocument(documentId, reviewer);
                    TempData["success_message"] = "Reviewer has been allocated to the document";
                }
                else
                {
                    dops.DeAllocateReviewerFromDocument(documentId, reviewer);
                    TempData["success_message"] = "Reviewer was deallocated from the document";
                }
            }
            catch (Exception ex)
            {
                TempData["error_message"] = ex.Message;
                new LogsOperations().AddLog(
                    new Log()
                {
                    Controller = RouteData.Values["controller"].ToString() + "/" + RouteData.Values["action"].ToString(),
                    Exception  = ex.Message,
                    Time       = DateTime.Now,
                    Message    = reviewer + "Faliure allocating reviewer"
                }
                    );
            }

            return(RedirectToAction("Index", "Documents"));
        }