public ActionResult Edit(tableCUSTOMER model)
 {
     if (ModelState.IsValid)
     {
         db.Entry(model).State = EntityState.Modified;
         db.SaveChanges();
         TempData["StatusMessage"] = "Edit successfully";
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Exemplo n.º 2
0
        public ActionResult Edit(tablePRODUCT model)
        {
            if (ModelState.IsValid)
            {
                using (var scope = new TransactionScope())
                {
                    var path = Server.MapPath("~/App_Data");
                    path = System.IO.Path.Combine(path, model.idSP.ToString());

                    UpdateModel(model);

                    db.Entry(model).State = EntityState.Modified;
                    db.SaveChanges();
                    scope.Complete();
                }
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult TraLoi(Contact model)
        {
            if (model.trangThai == true)
            {
                model.trangThai = true;
            }
            else if (model.traLoi == null)
            {
                model.trangThai = false;
            }
            else
            {
                model.trangThai = true;
            }
            model.thoigianTraLoi = DateTime.Now.Date;

            if (ModelState.IsValid)
            {
                db.Entry(model).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", "M4_Admin_TimKiemHienThi"));
            }
            return(View(model));
        }