public ActionResult SaveEdit(Redirect301 model) { Redirect301 dlcu = _redirect301Repository.GetById(model.Redirect301Id); dlcu.LinkCu = model.LinkCu; dlcu.LinkMoi = model.LinkMoi; _redirect301Repository.Update(dlcu); _unitOfWork.Commit(); return(RedirectToAction("Index")); }
public ActionResult Addnew(RedirectLinkModel model) { if (ModelState.IsValid) { Redirect301 tintuc = new Redirect301() { LinkCu = model.LinkCu, LinkMoi = model.LinkMoi, NgayTao = DateTime.Now }; _redirect301Repository.Add(tintuc); _unitOfWork.Commit(); } else { return(View("Create", model)); } return(RedirectToAction("Index")); }