Ejemplo n.º 1
0
        public void AddOrderMat(MaterialTypeOrderDto m)
        {
            Order o = db.Orders.FirstOrDefault(x => x.Id == m.OrderId);

            if (o != null)
            {
                db.MaterialTypeOrders.Add(MaterialTypeOrderToDal(m));
                db.SaveChanges();
            }
        }
Ejemplo n.º 2
0
 public MaterialTypeOrder MaterialTypeOrderToDal(MaterialTypeOrderDto Odto)
 {
     return(new MaterialTypeOrder()
     {
         //?
         OrderId = Odto.OrderId,
         Element = Odto.Element,
         Amount = Odto.Amount,
         StatusMaterialId = Odto.StatusMaterialId,
         MaterialId = Odto.MaterialId,
         ManagerComment = Odto.ManagerComment,
         PipeLength = Odto.PipeLength
     });
 }
Ejemplo n.º 3
0
        public void UpdateOrderMaterial(MaterialTypeOrderDto m)
        {
            MaterialTypeOrder mat;

            mat = db.MaterialTypeOrders.FirstOrDefault(mo => mo.Id == m.Id);
            if (mat != null)
            {
                mat.PipeLength       = m.PipeLength;
                mat.StatusMaterialId = m.StatusMaterialId;
                mat.MaterialId       = m.MaterialId;
                mat.Amount           = m.Amount;
                mat.Element          = m.Element;
                mat.ManagerComment   = m.ManagerComment;
            }
            db.SaveChanges();
        }