Пример #1
0
        public ActionResult Update(int?id, string title, string shortDescription, string FullDescription)
        {
            SuppliedService supServ = GetService(id);

            supServ.Title            = title;
            supServ.ShortDescription = shortDescription;
            supServ.FullDescription  = FullDescription;
            if (!id.HasValue)
            {
                model.SuppliedServices.Add(supServ);
            }
            model.SaveChanges();
            return(RedirectToAction("Details", new { id = supServ.Id }));
        }
Пример #2
0
        public ActionResult Update(int?id, string title, string body)
        {
            Post post = GetPost(id);

            post.Title    = title;
            post.Body     = body;
            post.DateTime = DateTime.Now;
            if (!id.HasValue)
            {
                model.Posts.Add(post);
            }
            ViewBag.CanEdit = true;
            model.SaveChanges();
            return(RedirectToAction("Details", new { id = post.Id }));
        }
Пример #3
0
        public ActionResult Update(int?id, string title, string body)
        {
            Comment com = GetComment(id);

            com.Title    = title;
            com.Body     = body;
            com.DateTime = DateTime.Now;
            if (!id.HasValue)
            {
                model.Comments.Add(com);
            }
            ViewBag.CanEdit = true;
            model.SaveChanges();
            return(RedirectToAction("Details", new { id = com.Id }));
        }
Пример #4
0
        public ActionResult Update(int?id, string firstName, string lastName, string email, string position, string image)
        {
            Team member = getMember(id);

            member.FirstName = firstName;
            member.LastName  = lastName;
            member.Email     = email;
            member.Position  = position;
            member.Image     = image;
            if (!id.HasValue)
            {
                model.Teams.Add(member);
            }
            ViewBag.CanEdit = true;
            model.SaveChanges();
            return(RedirectToAction("Details", new { id = member.Id }));
        }