Ejemplo n.º 1
0
        private OrdersLogDTO DTO(OrdersLog olog)
        {
            OrdersLogDTO ret = new OrdersLogDTO();

            ret.Accepted       = olog.Accepted;
            ret.Date           = olog.Date;
            ret.LocalClientID  = olog.LocalClientID;
            ret.LocalShipperID = olog.LocalShipperID;
            ret.OrderID        = olog.OrderID;
            ret.ProductID      = olog.ProductID;
            ret.Quantity       = olog.Quantity;
            return(ret);
        }
Ejemplo n.º 2
0
 public bool logLocalOrder(int orderId, int localClientId, int productId, string date, int quantity, int localShipperId, bool isAccepted, string justification)
 {
     using (var ctx = new ChocolateCoHQEntities1())
     {
         OrdersLog ol = new OrdersLog();
         ol.OrderID        = orderId;
         ol.LocalClientID  = localClientId;
         ol.ProductID      = productId;
         ol.Date           = DateTime.Parse(date);
         ol.Quantity       = quantity;
         ol.LocalShipperID = localShipperId;
         ol.Accepted       = (short)(isAccepted ? 1 : 0);
         ol.Justification  = justification;
         ctx.OrdersLog.Add(ol);
         int ret = ctx.SaveChanges();
         return(ret > 0);
     }
 }