Ejemplo n.º 1
0
        public virtual System.Web.Mvc.ActionResult Edit(Models.SportPaper sportPaper)
        {
            sportPaper.UpdateDateTime = Infrastructure.Utility.Now;

            if (ModelState.IsValid)
            {
                if (Request.Files["FileName"].ContentLength > 0)
                {
                    string directoryReal = string.Format("{0}/{1}", Server.MapPath("~/Content/NewsFiles"), Request.Files["FileName"].FileName);
                    string filname       = Request.Files["FileName"].FileName;
                    Request.Files["FileName"].SaveAs(directoryReal);
                    sportPaper.FileName = filname;
                }
                else
                {
                }
                sportPaper.Editor = System.Web.HttpUtility.HtmlDecode(sportPaper.Editor);
                UnitOfWork.SportPaperRepository.Update(sportPaper);

                UnitOfWork.Save();

                return(RedirectToAction(MVC.SportPaper.AdminIndex()));
            }

            return(View(sportPaper));
        }
        public override System.Web.Mvc.ActionResult Edit(Models.SportPaper sportPaper)
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Edit);

            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "sportPaper", sportPaper);
            EditOverride(callInfo, sportPaper);
            return(callInfo);
        }
Ejemplo n.º 3
0
        public virtual System.Web.Mvc.ActionResult DeleteConfirmed(System.Guid id)
        {
            Models.SportPaper oSportPaper =
                UnitOfWork.SportPaperRepository.Get()
                .Where(current => current.Id == id)
                .FirstOrDefault()
            ;

            UnitOfWork.SportPaperRepository.Delete(oSportPaper);

            UnitOfWork.Save();

            return(RedirectToAction(MVC.SportPaper.AdminIndex()));
        }
Ejemplo n.º 4
0
        public virtual System.Web.Mvc.ActionResult Details(System.Guid id)
        {
            Models.SportPaper oSportPaper =
                UnitOfWork.SportPaperRepository.Get()
                .Where(current => current.Id == id)
                .FirstOrDefault()
            ;

            if (oSportPaper == null)
            {
                return(HttpNotFound());
            }

            return(View(oSportPaper));
        }
Ejemplo n.º 5
0
        public virtual System.Web.Mvc.ActionResult Edit(System.Guid id)
        {
            Models.SportPaper oSportPaper =
                UnitOfWork.SportPaperRepository.Get()
                .Where(current => current.Id == id)
                .FirstOrDefault()
            ;
            ViewBag.Editor = System.Web.HttpUtility.HtmlDecode(oSportPaper.Editor);

            if (oSportPaper == null)
            {
                return(HttpNotFound());
            }

            return(View(oSportPaper));
        }
 partial void EditOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Models.SportPaper sportPaper);