Exemplo n.º 1
0
        public ActionResult Create(FormCollection formCollection, UserAuthViewModel vo)
        {
            if (ModelState.IsValid)
            {
                if (vo.Type == (int)AuthDataType.Promotion)
                    vo.BrandId = 0;
                var entity = vo.ToEntity<UserAuthEntity>();
                entity.CreatedUser = base.CurrentUser.CustomerId;
                entity.CreatedDate = DateTime.Now;
                entity.Status = (int)DataStatus.Normal;
                _authRepo.Insert(entity);
                return RedirectToAction("Edit", new { Id = entity.Id});
            }

            return View(vo);
        }