public ActionResult Edit(PictureViewModel model) { var Model = Crud.GetPicture(model.Id).ToModel(); Model.Public = model.Public; Model.Name = model.Name; Crud.CreateOrUpdate(Model.ToEntity()); return(PartialView(Model)); }
public ActionResult SaveEdit(AlbumViewModel Model) { var AccUserName = User.Identity.Name; AccountViewModel acc = (Crud.GetAccount(AccUserName)).ToModel(); Model.Account = acc; Crud.CreateOrUpdate(Model.ToEntity()); return(PartialView("_SingleAlbum", Model)); }
public ActionResult Create(AlbumViewModel Model) { if (ModelState.IsValid) { var AccUserName = User.Identity.Name; AccountViewModel acc = (Crud.GetAccount(AccUserName)).ToModel(); Model.Account = acc; Crud.CreateOrUpdate(Model.ToEntity()); } return(List()); }
public ActionResult SaveEdit(AccountViewModel Model) { string msg = "Save succeded"; if (Model.Email == "") { msg = "Your e-mail cant be nothing!"; } else { if (!Crud.CreateOrUpdate(Model.ToEntity())) { msg = "Unabled to save changes in database! contact personal!"; } } return(PartialView("_Result", msg)); }