Exemplo n.º 1
0
 public IActionResult GetFormForSaveAndUpdate(long id, string returnUrl)
 {
     ViewBag.ReturnUrl = returnUrl;
     var skill = new Skill();
     if (id > 0)
     {
         skill = DbContext.Skill.Get(id);
     }
     return PartialView("_SkillsForm", skill);
 }
Exemplo n.º 2
0
        public IActionResult SaveUpdate(Skill skill, string returnUrl)
        {
            if (skill.IsNew)
            {
                skill.UserId = User.GetId();
                if (DbContext.Skill.Create(skill) > 0)
                {
                    ShowSavedSuccessfullyToast();
                };


            }
            else
            {
                if (DbContext.Skill.Update(skill))
                {
                    ShowUpdateSuccessfullyToast();
                };
            }
            return Redirect(returnUrl);

        }