Esempio n. 1
0
        //שליפת הזמנות למשתמש

        public OrdersForUserView GetUserOrdersList(int userid)
        {
            //   שליפת כל ההזמנות מטבלתOrdersTbl


            try
            {
                Entities context = new Entities();

                List <OrderDetailsView> orderslist    = GetOrdersFromDB();
                OrdersForUserView       ordersForUser = null;
                if (orderslist != null)
                {
                    ordersForUser = new OrdersForUserView();
                    ordersForUser.UserReservations = orderslist.Where(p => p.Userid == userid).ToList();
                    for (int i = 0; i < ordersForUser.UserReservations.Count; i++)
                    {
                        int orderNum = ordersForUser.UserReservations[i].OrderNumber;

                        ordersForUser.UserReservations[i].mDogs = GetDogsForOrder(orderNum);
                    }
                }
                return(ordersForUser);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public UserDetailsView GetUserOrders(int UserID)
        {
            UserDetailsView userDetails = new UserDetailsView();

            //   שליפת כל ההזמנות מטבלתOrdersTbl
            try
            {
                Userservice userservice = new Userservice();
                userDetails = userservice.GetUser(UserID);
                OrdersForUserView ordersForUserView = GetUserOrdersList(UserID);
                userDetails.UserReservations = ordersForUserView.UserReservations;

                return(userDetails);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }