Ejemplo n.º 1
0
        public ActionResult NewTranslator(UserModel model)
        {
            if (model.IsValidForNewTranslator())
            {

                return Redirect("/admin/users");
            }

            model.Msg = "bir sorun oluştu...";
            return View(model);
        }
Ejemplo n.º 2
0
        public async Task<ActionResult> NewTranslator(UserModel model)
        {
            if (!model.IsValidForNewTranslator())
            {
                model.Msg = "bir sorun oluştu...";
                return View(model);
            }

            model.Password = Guid.NewGuid().ToString().Replace("-", string.Empty);
            model.Language = Thread.CurrentThread.CurrentUICulture.Name;
            var userId = await _userService.Create(model, SetLocaleRole.Translator.Value);
            if (userId == null)
            {
                model.Msg = "bir sorun oluştu...";
                return View(model);
            }

            //send mail to translator to welcome and ask for reset password

            return Redirect("/admin/users");
        }