static public void ResetOrder()
 {
     LocalOrder = new warehouse_orders()
     {
         status = (short)WarehouseOrderStatus.ReadyToOrder
     };
 }
Example #2
0
 static public void CreateNew(warehouse_orders order)
 {
     using (var db = new StudiaProjektBazyDanychEntities())
     {
         db.warehouse_orders.Add(order);
         db.SaveChanges();
     }
 }
Example #3
0
        static public void DeleteByID(int id)
        {
            using (var db = new StudiaProjektBazyDanychEntities())
            {
                warehouse_orders order = db.warehouse_orders.SingleOrDefault(x => x.id == id);

                var entry = db.Entry(order);
                if (entry.State == System.Data.Entity.EntityState.Detached)
                {
                    db.warehouse_orders.Attach(order);
                }
                db.warehouse_orders.Remove(order);
                db.SaveChanges();
            }
        }