Exemplo n.º 1
0
        public ActionResult Edit(FormCollection collection)
        {
            //try {
            var entity = new Entities.Dymbnail {
                ID          = int.Parse(collection["id"]),
                Title       = collection["txtTitle"],
                Description = collection["txtDescription"],
                Content     = collection["txtContent"]
            };

            if (entity.ID > 1000)
            {
                Update(entity);
            }
            else
            {
                Create(entity);
            }

            //return RedirectToAction("EditVariables", new { id = entity.ID });
            return(RedirectToAction("Index"));

            /*} catch {
             *  return View();
             * }*/
        }
Exemplo n.º 2
0
 public ActionResult Edit(int?id)
 {
     Entities.Dymbnail model;
     if (id > 1000)
     {
         model = Facade.Dymbnails.Get(id.Value);
     }
     else
     {
         model         = new Entities.Dymbnail();
         model.Content = DymbnailsHelper.DefaultContentTemplate;
     }
     return(View(model));
 }
Exemplo n.º 3
0
 private void Update(Entities.Dymbnail entity)
 {
     Facade.Dymbnails.Update(entity);
 }
Exemplo n.º 4
0
 private void Create(Entities.Dymbnail entity)
 {
 }