Exemplo n.º 1
0
        public ActionResult DeleteHelp(Guid Id)
        {
            HelpDesc h = db.HelpDesc.Find(Id);

            db.Entry <HelpDesc>(h).State = System.Data.Entity.EntityState.Deleted;
            db.SaveChanges();
            return(RedirectToAction("Collect"));
        }
Exemplo n.º 2
0
        public ActionResult SaveHelp(HelpDesc HD, string ReturnUrl)
        {
            ReturnUrl = Request.UrlReferrer.ToString();

            HelpDesc h = new HelpDesc
            {
                Id      = Guid.NewGuid(),
                Title   = HD.Title,
                Type    = HD.Type,
                Path    = HelpTypeDic[HD.Type] + "/" + HD.Path,
                Keyword = HD.Keyword,
                Content = HD.Content
            };

            db.HelpDesc.Add(h);
            db.SaveChanges();
            return(Redirect(ReturnUrl));
        }