コード例 #1
0
ファイル: ProductController.cs プロジェクト: thuccd/TTCSDL_01
 public ActionResult ChinhSua(PRODUCT model, HttpPostedFileBase ShowImage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(model).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "PersonID,Personusername,PersonPassword,PersonEmail,PersonName,PersonPhone,PersonAdress,CreatedDate")] PERSON pERSON)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pERSON).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pERSON));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "MaNV,HoTen,NgaySinh,SDT,ViTri,LuongCoBan")] NhanVien nhanVien)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nhanVien).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nhanVien));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "ResourcesID,Resourcesname,Quantity,Total")] RESOURCE rESOURCE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rESOURCE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(rESOURCE));
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "CustomerID,CustomerUsername,CustomerPassword,CustomerEmail,CustomerName,CustomerPhone,CustomerAdress,CreatedDate")] CUSTOMER cUSTOMER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cUSTOMER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cUSTOMER));
 }
コード例 #6
0
        public async Task <IHttpActionResult> PutNGUOIDUNG(NGUOIDUNG nGUOIDUNG)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Entry(nGUOIDUNG).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }