public IActionResult EditFrameworkFlag(CustomFlagViewModel model, int frameworkId, string actionname, int flagId) { if (ModelState.IsValid) { if (actionname == "Edit") { frameworkService.UpdateFrameworkCustomFlag(frameworkId, model.Id, model.FlagName, model.FlagGroup, model.FlagTagClass); } else { frameworkService.AddCustomFlagToFramework(frameworkId, model.FlagName, model.FlagGroup, model.FlagTagClass); } return(RedirectToAction("EditFrameworkFlags", "Frameworks", new { frameworkId })); } return(View("Developer/EditCustomFlag", model)); }
public IActionResult EditFrameworkFlag(int frameworkId, string actionname, int flagId) { var model = new CustomFlagViewModel(); if (actionname == "Edit") { var flag = frameworkService.GetCustomFlagsByFrameworkId(frameworkId, (int?)flagId).FirstOrDefault(); model = new CustomFlagViewModel() { Id = flag.FlagId, FlagGroup = flag.FlagGroup, FlagName = flag.FlagName, FlagTagClass = flag.FlagTagClass }; } return(View("Developer/EditCustomFlag", model)); }