Example #1
0
 public ActionResult Accept(int id)
 {
     if (System.Web.HttpContext.Current.Session["UserName"] == null)
     {
         return(RedirectToAction("logon", "account"));
     }
     else
     {
         if (System.Web.HttpContext.Current.Session["UserName"].ToString().Equals("Admin"))
         {
             return(RedirectToAction("Index", "Admin"));
         }
         else
         {
             int result = UserModel.AcceptApproval(id.ToString());
             if (result == 1)
             {
                 ViewData["Message"] = "Record has been successfully approved!";
             }
             else if (result == 0)
             {
                 ViewData["Message"] = "You are not Authorized to Approve this Record!";
             }
             else
             {
                 ViewData["Message"] = "Something went wrong, try again later!";
             }
             return(View());
         }
     }
 }