Esempio n. 1
0
 public ActionResult Index(string searchString)
 {
     if (!String.IsNullOrEmpty(searchString))
     {
         SearchController s = new SearchController();
         return(s.SearchOnDatabase(searchString));
     }
     else
     {
         if (AccountController.CheckPermission("Survey-Index"))
         {
             System.Web.HttpContext.Current.Session["action"] = "Survey-Index";
             UpdateList();
             var user = AccountController.GetUser();
             if (user.RoleName == "User")
             {
                 return(View(listSurvey.Where(x => x.UserId == user.Id && x.IsDeleted == false)));
             }
             else
             {
                 return(View(listSurvey));
             }
         }
         else
         {
             return(RedirectToAction("Index", "Home"));
         }
     }
 }
Esempio n. 2
0
 public ActionResult Index(string searchString)
 {
     if (!String.IsNullOrEmpty(searchString))
     {
         SearchController s = new SearchController();
         return(s.SearchOnDatabase(searchString));
     }
     else
     {
         var list = (List <SearchViewModel>)System.Web.HttpContext.Current.Session["lists"];
         return(View(list));
     }
 }
Esempio n. 3
0
 public ActionResult Index(string searchString)
 {
     if (!String.IsNullOrEmpty(searchString))
     {
         SearchController s = new SearchController();
         return(s.SearchOnDatabase(searchString));
     }
     else
     {
         if (AccountController.CheckPermission("Image-Index"))
         {
             UpdateList();
             return(View(listImages.OrderBy(x => x.Name)));
         }
         else
         {
             return(RedirectToAction("Index", "Home"));
         }
     }
 }
Esempio n. 4
0
 // GET: Notifications
 public ActionResult Index(string searchString)
 {
     if (!String.IsNullOrEmpty(searchString))
     {
         SearchController s = new SearchController();
         return(s.SearchOnDatabase(searchString));
     }
     else
     {
         if (AccountController.CheckPermission("Notification-Index"))
         {
             List <NotificationViewModel> n = new List <NotificationViewModel>();
             ReceiveEmail(n);
             //if (n.Count > 1)
             //{
             //    listNotification.Sort((x, y) => y.CreatedDate.CompareTo(x.CreatedDate));
             //}
             foreach (var item in n.ToList())
             {
                 if (item.Message.Length >= 30)
                 {
                     item.Message = item.Message.Substring(0, 30) + "...";
                 }
             }
             ViewBag.Count = n.Count;
             return(View(n));
         }
         else if (AccountController.CheckPermission("Notification-Sent"))
         {
             return(RedirectToAction("Sent"));
         }
         else
         {
             return(RedirectToAction("Index", "Home"));
         }
     }
 }