コード例 #1
0
        public List <Order> getOrderByUser(int id)
        {
            List <Orders> dbOrders = new List <Orders>();
            List <Order>  orders   = new List <Order>();

            dbOrders = MangerRepasitory.getOrderByUser(id);
            if (dbOrders != null)
            {
                dbOrders.ForEach(dbOrder =>
                {
                    orders.Add(ordersMapper.MapToClientOrder(dbOrder));
                });
            }
            return(orders);
        }
コード例 #2
0
        public int UploadPhotosToOrder(OrderPhotos orderPhotos)
        {
            if (orderPhotos == null || orderPhotos.photos.Count == 0)
            {
                return(0);
            }
            List <Photos> dbPhotos = new List <Photos>();

            orderPhotos.photos.ForEach((photoUrl) => {
                dbPhotos.Add(new Photos
                {
                    orderId  = orderPhotos.orderId,
                    photoUrl = photoUrl
                });
            });
            return(MangerRepasitory.UploadPhotosToOrder(dbPhotos));
        }
コード例 #3
0
 public HttpResponseMessage getAll()
 {
     return(Request.CreateResponse(HttpStatusCode.OK, MangerRepasitory.getAll()));
 }