Skip to content

Commit

Permalink
nopSolutions#1897 Further changes on "Refactoring of controllers in …
Browse files Browse the repository at this point in the history
…the admin area"
  • Loading branch information
skoshelev committed Apr 25, 2018
1 parent f000bfb commit 71f279c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ public virtual IActionResult Create(CurrencyModel model, bool continueEditing)

SuccessNotification(_localizationService.GetResource("Admin.Configuration.Currencies.Added"));

if (continueEditing)
return RedirectToAction("Edit", new { id = currency.Id });
if (!continueEditing)
return RedirectToAction("List");

return RedirectToAction("List");
return RedirectToAction("Edit", new { id = currency.Id });
}

//prepare model
Expand Down Expand Up @@ -292,10 +292,10 @@ public virtual IActionResult Edit(CurrencyModel model, bool continueEditing)

SuccessNotification(_localizationService.GetResource("Admin.Configuration.Currencies.Updated"));

if (continueEditing)
return RedirectToAction("Edit", new { id = currency.Id });
if (!continueEditing)
return RedirectToAction("List");

return RedirectToAction("List");
return RedirectToAction("Edit", new { id = currency.Id });
}

//prepare model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,10 @@ public virtual IActionResult Edit(MessageTemplateModel model, bool continueEditi

SuccessNotification(_localizationService.GetResource("Admin.ContentManagement.MessageTemplates.Updated"));

if (continueEditing)
{
return RedirectToAction("Edit", new { id = messageTemplate.Id });
}
if (!continueEditing)
return RedirectToAction("List");

return RedirectToAction("List");
return RedirectToAction("Edit", new { id = messageTemplate.Id });
}

//prepare model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2609,17 +2609,17 @@ public virtual IActionResult ProductAttributeMappingCreate(ProductAttributeMappi

SuccessNotification(_localizationService.GetResource("Admin.Catalog.Products.ProductAttributes.Attributes.Added"));

if (continueEditing)
if (!continueEditing)
{
//selected tab
SaveSelectedTabName();
SaveSelectedTabName("tab-product-attributes");

return RedirectToAction("ProductAttributeMappingEdit", new { id = productAttributeMapping.Id });
return RedirectToAction("Edit", new { id = product.Id });
}

SaveSelectedTabName("tab-product-attributes");
//selected tab
SaveSelectedTabName();

return RedirectToAction("Edit", new { id = product.Id });
return RedirectToAction("ProductAttributeMappingEdit", new { id = productAttributeMapping.Id });
}

public virtual IActionResult ProductAttributeMappingEdit(int id)
Expand Down Expand Up @@ -2699,17 +2699,17 @@ public virtual IActionResult ProductAttributeMappingEdit(ProductAttributeMapping

SuccessNotification(_localizationService.GetResource("Admin.Catalog.Products.ProductAttributes.Attributes.Updated"));

if (continueEditing)
if (!continueEditing)
{
//selected tab
SaveSelectedTabName();
SaveSelectedTabName("tab-product-attributes");

return RedirectToAction("ProductAttributeMappingEdit", new { id = productAttributeMapping.Id });
return RedirectToAction("Edit", new { id = product.Id });
}

SaveSelectedTabName("tab-product-attributes");
//selected tab
SaveSelectedTabName();

return RedirectToAction("Edit", new { id = product.Id });
return RedirectToAction("ProductAttributeMappingEdit", new { id = productAttributeMapping.Id });
}

[HttpPost]
Expand Down

0 comments on commit 71f279c

Please sign in to comment.