コード例 #1
0
ファイル: PagesController.cs プロジェクト: RonenZ/EitanMVC
        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);
        }
コード例 #2
0
ファイル: PagesController.cs プロジェクト: RonenZ/EitanMVC
        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);
        }