mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 12:53:33 +08:00
Renaming methods to BuildDisplayModel, BuildEditorModel, UpdateEditorModel and models to ItemDisplayModel, ItemEditorModel
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043654
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Orchard.Users.Controllers {
|
||||
public ActionResult Create() {
|
||||
var user = _contentManager.New("user");
|
||||
var model = new UserCreateViewModel {
|
||||
ItemView = _contentManager.GetEditorViewModel(user, null)
|
||||
EditorModel = _contentManager.BuildEditorModel(user, null)
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Orchard.Users.Controllers {
|
||||
ModelState.AddModelError("ConfirmPassword", T("Password confirmation must match").ToString());
|
||||
}
|
||||
if (ModelState.IsValid == false) {
|
||||
model.ItemView = _contentManager.UpdateEditorViewModel(_contentManager.New("user"), null, this);
|
||||
model.EditorModel = _contentManager.UpdateEditorModel(_contentManager.New("user"), null, this);
|
||||
return View(model);
|
||||
}
|
||||
var user = _membershipService.CreateUser(new CreateUserParams(
|
||||
@@ -69,7 +69,7 @@ namespace Orchard.Users.Controllers {
|
||||
model.Password,
|
||||
model.Email,
|
||||
null, null, true));
|
||||
model.ItemView = _contentManager.UpdateEditorViewModel(user, null, this);
|
||||
model.EditorModel = _contentManager.UpdateEditorModel(user, null, this);
|
||||
if (ModelState.IsValid == false) {
|
||||
//TODO: rollback transaction
|
||||
return View(model);
|
||||
@@ -80,14 +80,14 @@ namespace Orchard.Users.Controllers {
|
||||
|
||||
public ActionResult Edit(int id) {
|
||||
var model = new UserEditViewModel { User = _contentManager.Get<User>(id) };
|
||||
model.ItemView = _contentManager.GetEditorViewModel(model.User.ContentItem, null);
|
||||
model.EditorModel = _contentManager.BuildEditorModel(model.User.ContentItem, null);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Edit(int id, FormCollection input) {
|
||||
var model = new UserEditViewModel { User = _contentManager.Get<User>(id) };
|
||||
model.ItemView = _contentManager.UpdateEditorViewModel(model.User.ContentItem, null, this);
|
||||
model.EditorModel = _contentManager.UpdateEditorModel(model.User.ContentItem, null, this);
|
||||
|
||||
if (!TryUpdateModel(model, input.ToValueProvider())) {
|
||||
return View(model);
|
||||
|
Reference in New Issue
Block a user