Пример #1
0
 public void updateCategory(Category category)
 {
     using (var context = new CContext())
     {
         context.Entry(category).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Пример #2
0
 public void UpdateProducts(Product product)
 {
     using (var context = new CContext())
     {
         context.Entry(product).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Пример #3
0
 public void SaveProducts(Product product)
 {
     using (var context = new CContext())
     {
         context.Entry(product).State = EntityState.Unchanged;
         context.Products.Add(product);
         context.SaveChanges();
     }
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "RecognitionID,CoreValueTypeID,recognitionDescription,recognitionDate,profileID")] Recognition recognition)
 {
     if (ModelState.IsValid)
     {
         db.Entry(recognition).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //ViewBag.CoreValueTypeID = new SelectList(db.CoreValueType, "CoreValueTypeID", "CoreValueName", recognition.value);
     ViewBag.profileID = new SelectList(db.profile, "profileID", "employeeFirstName", recognition.profileID);
     return(View(recognition));
 }
Пример #5
0
        public bool UpdateOrderStatus(int id, string status)
        {
            using (var context = new CContext())
            {
                var order = context.Orders.Find(id);

                order.Status = status;

                context.Entry(order).State = EntityState.Modified;

                return(context.SaveChanges() > 0);
            }
        }