示例#1
0
        public static List <OrderModel> GetListOrders()
        {
            List <BOLOrder> userorsers = RentOrder.GetUserFrom_db();

            try
            {
                List <OrderModel> returneduserorsers = new List <OrderModel>();


                foreach (var item in userorsers)
                {
                    returneduserorsers.Add(new OrderModel
                    {
                        StartDate        = item.StartDate,
                        ReturnDate       = item.ReturnDate,
                        UserName         = RentUser.GetUserName(item.UserID),
                        VehicleNumber    = RentCarsInVehicleInventory.GetVehicleNumber(item.VehiclesID),
                        ActualReturnDate = item.ActualReturnDate
                    });
                }
                return(returneduserorsers);
            }
            catch { }
            return(null);
        }
示例#2
0
 public static List <OrderModel> GetUserOrdesrByUserName(string userName)
 {
     try
     {
         List <OrderModel> orderList = new List <OrderModel>();
         List <BOLOrder>   orders    = RentOrder.GetUsersOrdesrByUserName(userName);
         foreach (var item in orders)
         {
             orderList.Add(new OrderModel
             {
                 StartDate        = item.StartDate,
                 ReturnDate       = item.ReturnDate,
                 UserName         = userName,
                 VehicleNumber    = RentCarsInVehicleInventory.GetVehicleNumber(item.VehiclesID),
                 ActualReturnDate = item.ActualReturnDate
             });
         }
         return(orderList);
     }
     catch { return(null); }
 }