Exemple #1
0
        // GET: ChooseUs
        public async Task <IActionResult> Index()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(RedirectToAction(nameof(AccountController.Login), "Account"));
            }

            else
            {
                try
                {
                    ViewBag.sms = TempData["sms"].ToString();
                }
                catch
                {
                }

                var model = new ChooseUsViewModel();
                model.Notificaciones = _empleadosData.GetNotifications();
                model.Motivos        = _empleadosData.GetAllTheReasons();
                return(View(model));
            }
        }
Exemple #2
0
        // GET: ChooseUs/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(RedirectToAction(nameof(AccountController.Login), "Account"));
            }
            if (id == null)
            {
                return(NotFound());
            }
            var model = new ChooseUsViewModel();

            model.Notificaciones = _empleadosData.GetNotifications();
            model.ChooseUs       = await _context.ChooseUs
                                   .SingleOrDefaultAsync(m => m.ID == id);

            model.Image  = model.ChooseUs.Image;
            model.Option = model.ChooseUs.Option;
            if (model.ChooseUs == null)
            {
                return(NotFound());
            }

            return(View(model));
        }
Exemple #3
0
        // GET: ChooseUs/Create
        public async Task <IActionResult> Create()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(RedirectToAction(nameof(AccountController.Login), "Account"));
            }
            var model = new ChooseUsViewModel();

            model.Notificaciones = _empleadosData.GetNotifications();
            return(View(model));
        }