예제 #1
0
        public async Task <IActionResult> PutTB_USER([FromRoute] string id, [FromBody] TB_USER tB_USER)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tB_USER.UserId)
            {
                return(BadRequest());
            }

            _context.Entry(tB_USER).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TB_USERExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #2
0
        public IHttpActionResult PutReviews(int id, Reviews reviews)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != reviews.ID)
            {
                return(BadRequest());
            }

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ReviewsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #3
0
 public ActionResult Edit([Bind(Include = "ID,CategoryName")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "ID,PostTitle,Image,CategoryID")] Post post)
 {
     if (ModelState.IsValid)
     {
         post.DateAdded       = DateTime.Now;
         db.Entry(post).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(post));
 }
예제 #5
0
 public ActionResult Edit([Bind(Include = "CategoryID,Created,Modified,CategoryName,Description")] Category category)
 {
     if (ModelState.IsValid)
     {
         category.Modified        = DateTime.UtcNow.Ticks;
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public bool Edit(CustomerProfile obj)
 {
     spc.Entry <CustomerProfile>(obj).State = System.Data.Entity.EntityState.Modified;
     spc.CustomerProfiles.Attach(obj);
     return(true);
 }
예제 #7
0
 public bool Edit(CustomerLogin obj)
 {
     spc.Entry <CustomerLogin>(obj).State = System.Data.Entity.EntityState.Modified;
     return(true);
 }
예제 #8
0
 public bool Edit(Token obj)
 {
     spc.Entry <Token>(obj).State = System.Data.Entity.EntityState.Modified;
     return(true);
 }
예제 #9
0
 public bool Edit(Product obj)
 {
     spc.Entry <Product>(obj).State = System.Data.Entity.EntityState.Modified;
     return(true);
 }