Exemple #1
0
        public async Task <IActionResult> MyNotifications()
        {
            //find the agent from the Session context
            var agent   = _agentProcessor.LoadAgent(_accessor.HttpContext.Session.GetString("username")).Result;
            var records = await _reportProcessor.LoadRecords("Notification");

            CommonViewModel model = new CommonViewModel()
            {
                contactRecords = records.Where(x => x.SentTo == agent.Email)
            };

            return(View(model));
        }
Exemple #2
0
        public async Task <IActionResult> Login(UserCred userCred)
        {
            var result = await _login.Login(userCred);

            if (result == null)
            {
                return(RedirectToAction("Login", "Login", new { code = 1 }));
            }

            //Debug.WriteLine("RESULT : "+result);
            var agent = _agentProcessor.LoadAgent(userCred.Username);

            if (agent.Result.NeedsNewPassword)
            {
                return(RedirectToAction("ResetPassword", "Agent", agent.Result));
            }
            return(RedirectToAction("Index", "Home"));
        }
Exemple #3
0
        public async Task <IActionResult> MyTickets()
        {
            if (_accessor.HttpContext.Session.GetString("role") == "user")
            {
                return(RedirectToAction("NoAccess", "Home"));
            }

            CommonViewModel model = new CommonViewModel()
            {
                tickets       = await _ticketProcessor.LoadTickets(),
                ticketTypes   = await _ticketProcessor.LoadTypes(),
                jurisdictions = await _jurisdictionProcessor.LoadJurisdictions(),
                AgentId       = _agentProcessor.LoadAgent(_accessor.HttpContext.Session.GetString("username")).Result.Id
            };

            if (model.tickets == null)
            {
                return(RedirectToAction("Login", "Login"));
            }

            return(View(model));
        }
Exemple #4
0
        public IActionResult Edit(string username)
        {
            var model = _agentProcessor.LoadAgent(username).Result;

            return(View(model));
        }