Example #1
0
        /// <summary>
        /// Cập nhật trang giới thiệu
        /// </summary>
        /// <param name="ab"></param>
        /// <returns></returns>
        public bool Update(tbl_About ab)
        {
            var model = db.tbl_About.Find(ab.ID);

            model.ModifyBy   = ab.ModifyBy;
            model.ModifyDate = ab.ModifyDate;
            model.Content    = ab.Content;
            db.SaveChanges();
            return(true);
        }
Example #2
0
 public ActionResult EditAbout([Bind(Include = "Id,NoiDungVN,NoiDungEN,NoiDungTL")] tbl_About tbl_About)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_About).State = EntityState.Modified;
         db.SaveChanges();
         var model = db.tbl_About;
         return(RedirectToAction("EditAbout", model));
     }
     return(View(tbl_About));
 }
Example #3
0
        //Edit tour
        public ActionResult EditAbout(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_About tbl_About = db.tbl_About.Find(id);

            if (tbl_About == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_About));
        }
 public ActionResult Index(tbl_About model)
 {
     if (ModelState.IsValid)
     {
         var session = (StaffLogin)Session[Common.CommonConstants.STAFF_SESSION];
         model.ModifyBy   = session.UserId;
         model.ModifyDate = DateTime.Now;
         var result = new AboutDAO().Update(model);
         if (result)
         {
             SetAlert("Cập nhật thành công.", "success");
         }
         else
         {
             SetAlert("Có lỗi! Cập nhật không thành công", "danger");
         }
     }
     return(View(model));
 }