Пример #1
0
 public IActionResult New(int message)
 {
     if (!DB.StylistCheckBySessionId(HttpContext.Session.Id))
     {
         return(RedirectToAction("index", "home"));
     }                                                                                                                  //check for logout
     ViewBag.LoggedIn      = true;
     ViewBag.SpecialtyList = DB.SpecialtyGetAll();
     ViewBag.message       = ErrorCodeMessages.FromCode(message);
     return(View());
 }
Пример #2
0
 public IActionResult Edit(string userId, int message)
 {
     if (!DB.StylistCheckBySessionId(HttpContext.Session.Id))
     {
         return(RedirectToAction("index", "home"));
     }                                                                                                                  //check for logout
     ViewBag.User     = DB.StylistGetBySessionId(HttpContext.Session.Id);
     ViewBag.EditUser = DB.StylistGetById(int.Parse(userId));
     ViewBag.LoggedIn = true;
     ViewBag.message  = ErrorCodeMessages.FromCode(message);
     return(View());
 }
Пример #3
0
        public IActionResult New(int message)
        {
            if (!DB.StylistCheckBySessionId(HttpContext.Session.Id))
            {
                return(RedirectToAction("index", "home"));
            }                                                                                                                  //check for logout
            ViewBag.LoggedIn = true;
            ViewBag.message  = ErrorCodeMessages.FromCode(message);
            List <Stylist> users = DB.StylistGetAll();

            users            = users.OrderBy(u => u.Name).ToList();
            ViewBag.UserList = users;
            return(View());
        }
Пример #4
0
 public IActionResult Index(int message)
 {
     if (DB.StylistCheckBySessionId(HttpContext.Session.Id))
     {
         return(RedirectToAction("index", "stylist"));
     }                                                                                                                    //check for login
     if (DB.StylistGetAll().Count == 0)
     {
         return(RedirectToAction("new", "stylist"));
     }
     ViewBag.LoggedIn = false;
     ViewBag.message  = ErrorCodeMessages.FromCode(message);
     return(View());
 }
Пример #5
0
 public IActionResult New(int message)
 {
     if (!DB.StylistCheckBySessionId(HttpContext.Session.Id)) //check for logout
     {
         if (DB.StylistGetAll().Count > 0)                    //no users initiate administrator login
         {
             return(RedirectToAction("index", "home"));
         }
         else
         {
             ViewBag.message = ErrorCodeMessages.FromCode(4);
             return(View());
         }
     }
     ViewBag.LoggedIn = true;
     ViewBag.message  = ErrorCodeMessages.FromCode(message);
     return(View());
 }