Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AdviceBack adviceBack = db.AdviceBacks.Find(id);

            db.AdviceBacks.Remove(adviceBack);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit(AdviceBack adviceBack)
 {
     if (ModelState.IsValid)
     {
         AdviceBack advice = db.AdviceBacks.Find(adviceBack.Id);
         advice.ChangeTime   = DateTime.Now;
         advice.ChangePerson = this.Name;
         advice.Content      = adviceBack.Content;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(adviceBack));
 }
Exemplo n.º 3
0
        // GET: AdviceBack/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AdviceBack adviceBack = db.AdviceBacks.Find(id);

            if (adviceBack == null)
            {
                return(HttpNotFound());
            }
            return(View(adviceBack));
        }
Exemplo n.º 4
0
        public ActionResult Create(AdviceBack adviceBack)
        {
            if (ModelState.IsValid)
            {
                adviceBack.CompanyId    = this.CompanyId;
                adviceBack.RecordTime   = DateTime.Now;
                adviceBack.RecordPerson = this.Name;
                db.AdviceBacks.Add(adviceBack);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(adviceBack));
        }