示例#1
0
        public IActionResult ListCallCenterUser()
        {
            var list = _authService.GetAllCallCenterUser();
            List <CallCenterUserViewModel> modelList = new List <CallCenterUserViewModel>();

            foreach (var item in list)
            {
                CallCenterUserViewModel model = new CallCenterUserViewModel()
                {
                    Id          = item.Id,
                    CreatedDate = item.CreatedDate,
                    FullName    = item.FullName,
                    IsActive    = item.IsActive
                };
                modelList.Add(model);
            }
            return(View(modelList));
        }
示例#2
0
        public IActionResult CreateCallCenterUser(CallCenterUserViewModel model)
        {
            if (model.FullName == null || model.Password == null)
            {
                return(View());
            }

            User user = new User()
            {
                IsActive    = model.IsActive,
                FullName    = model.FullName,
                Password    = _authService.PasswordHasher(model.Password),
                CreatedDate = DateTime.Now,
                RoleId      = 4,
                CreatedBy   = 2
            };

            _authService.CreateCallCenter(user);
            return(RedirectToAction("ListCallCenterUser", "CallCenter"));
        }
示例#3
0
        public IActionResult CreateCallCenterUser(CallCenterUserViewModel model)
        {
            if (model.FullName == null || model.Password == null)
            {
                return(View());
            }

            User user = new User()
            {
                IsActive    = true,
                FullName    = model.FullName,
                Password    = _authService.PasswordHasher(model.Password),
                CreatedDate = DateTime.Now,
                RoleId      = 1,
                CreatedBy   = 2
            };

            _authService.CreateCallCenter(user);
            _logger.LogInformation("CallCenterController.CreateCallCenter method called!!!");

            return(RedirectToAction("ListCallCenterUser", "CallCenter"));
        }