Exemple #1
0
        public void OrderSign(int id)
        {
            OrderFormView tmp = OrderList.Find(id);

            tmp.status = "Подписан";

            Entry(tmp).State = EntityState.Modified;
            SaveChanges();
        }
Exemple #2
0
        public OrderFormView GetOrderById(int id)
        {
            OrderFormView tmp = OrderList.Find(id);

            if (tmp != null)
            {
                var obj_list = ObjectList.Where(c => c.OrderFormViewId == id);

                if (obj_list != null)
                {
                    tmp.obj_list = obj_list.ToList();
                }
            }

            return(tmp);
        }
Exemple #3
0
        public void UpdateOrder(OrderFormView order)
        {
            var list = ObjectList.Where(c => c.OrderFormViewId == order.id).AsEnumerable();

            if (list != null)
            {
                foreach (var obj in list)
                {
                    Entry(obj).State = EntityState.Deleted;
                }
            }

            foreach (var obj in order.obj_list)
            {
                ObjectList.Add(obj);
            }

            Entry(order).State = EntityState.Modified;
            SaveChanges();
        }
Exemple #4
0
 public void AddNewOrder(OrderFormView order)
 {
     OrderList.Add(order);
     SaveChanges();
 }
Exemple #5
0
 public void SetDeletedStateOrder(OrderFormView order)
 {
     order.status       = "Удаленная";
     Entry(order).State = EntityState.Modified;
     SaveChanges();
 }