public ActionResult Edit([Bind(Include = "id,name,img,description,link,detaik,meta,hide,order,datebegin")] News news, HttpPostedFileBase img)
        {
            var  path     = "";
            var  filename = "";
            News temp     = getById(news.id);

            if (ModelState.IsValid)
            {
                if (img != null)
                {
                    filename = DateTime.Now.ToString("dd-MM-yy-mm-ss-") + img.FileName;
                    path     = Path.Combine(Server.MapPath("~/Content/upload/img/news"), filename);
                    img.SaveAs(path);
                    temp.img = filename;
                }
                temp.name            = news.name;
                temp.description     = news.description;
                temp.detaik          = news.detaik;
                temp.meta            = Functions.ConvertToUnSign(news.meta);
                temp.hide            = news.hide;
                temp.order           = news.order;
                db.Entry(temp).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(news));
        }
 public ActionResult Edit([Bind(Include = "ID,NgayTao,TenKH,DienThoai,DiaChi,Email,TrangThai")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(order));
 }
 public ActionResult Edit([Bind(Include = "id,name,link,meta,hide,order,datebegin")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,Phone,Email,Address,Content,CreatedDate,Status")] Feedback2 feedback2)
 {
     if (ModelState.IsValid)
     {
         db.Entry(feedback2).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(feedback2));
 }
 public ActionResult Edit([Bind(Include = "id,name,price,img,description,meta,size,color,hide,order,datebegin,categoryid")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
 public ActionResult Edit([Bind(Include = "id,name,price,img,description,meta,size,color,hide,order,datebegin,categoryid")] Product product, HttpPostedFileBase img)
 {
     try
     {
         var     path     = "";
         var     filename = "";
         Product temp     = db.Products.Find(product.id);
         if (ModelState.IsValid)
         {
             if (img != null)
             {
                 filename = DateTime.Now.ToString("dd-MM-yy-hh-mm-ss") + img.FileName;
                 path     = Path.Combine(Server.MapPath("~/Content/images"), filename);
                 img.SaveAs(path);
                 temp.img = filename;
             }
             temp.name            = product.name;
             temp.price           = product.price;
             temp.description     = product.description;
             temp.meta            = product.meta;
             temp.color           = product.color;
             temp.size            = product.size;
             temp.hide            = product.hide;
             temp.order           = product.order;
             db.Entry(temp).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index", "Products", new { id = product.categoryid }));
         }
     }
     catch (DbEntityValidationException e)
     {
         throw e;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(View(product));
 }
        public ActionResult Edit([Bind(Include = "Id,name,meta,img")] banner banner, HttpPostedFileBase img)
        {
            var    path     = "";
            var    filename = "";
            banner temp     = getById(banner.Id);

            if (ModelState.IsValid)
            {
                if (img != null)
                {
                    filename = DateTime.Now.ToString("dd-MM-yy-hh-mm-ss") + img.FileName;
                    path     = Path.Combine(Server.MapPath("~/Content/images"), filename);
                    img.SaveAs(path);
                    temp.img = filename;
                }
                temp.name            = banner.name;
                temp.meta            = Functions.ConvertToUnSign(banner.meta);
                db.Entry(temp).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(banner));
        }