Example #1
0
        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));
        }
Example #2
0
        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));
        }
Example #3
0
 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));
        }