Esempio n. 1
0
        public ActionResult Create(Page Entity, SEO SEOEntity, HttpPostedFileBase[] SEOfile)
        {
            if (ModelState.IsValid)
            {
                UpsertSEO(Entity, 0, SEOEntity, SEOfile, "Pages");

                Entity.Date_Creation = DateTime.Now;
                Uow.PagesRepository.Add(Entity);

                Uow.Commit();

                return RedirectToAction("Index");
            }

            return View(Entity);
        }
Esempio n. 2
0
        public ActionResult Edit(Page EditEntity, int id, SEO POSTSEO, HttpPostedFileBase[] SEOfile, int SEOID = 0)
        {
            if (ModelState.IsValid)
            {
                var Entity = Uow.PagesRepository.GetByID(id);
                UpdateModel(Entity);

                UpsertSEO(Entity, SEOID, POSTSEO, SEOfile, "Pages");

                Uow.Commit();

                return RedirectToAction("Index");
            }

            return View(EditEntity);
        }