コード例 #1
0
        public Result Add(ViewOrder order)
        {
            Order _order = ViewOrder.ToEntity(order);

            _order = _repository.Add(_order);
            return(new Result(0, "", ViewOrder.ToViewModel(_order)));
        }
コード例 #2
0
        public ViewOrder Get(int classID, int userID)
        {
            //Order order = _repository.Orders.FirstOrDefault(o => o.Id == classID && userID == o.UserId);
            Order order = _repository.Orders.FirstOrDefault(o => o.ClassId == classID && userID == o.UserId);

            return(ViewOrder.ToViewModel(order));
        }
コード例 #3
0
        public ViewOrder Get(int id)
        {
            //Order order = _repository.Orders.FirstOrDefault(o => o.Id == id);
            Order order = _repository.Get(id);

            return(ViewOrder.ToViewModel(order));
        }
コード例 #4
0
        public List <ViewOrder> GetOrder(string whereStr, int page, int pagesize, out int count)
        {
            List <Order>     list  = _repository.GetOrder(whereStr, page, pagesize, out count);
            List <ViewOrder> model = new List <ViewOrder>();

            foreach (var item in list)
            {
                model.Add(ViewOrder.ToViewModel(item));
            }
            return(model);
        }
コード例 #5
0
        public List <ViewOrder> GetOrdersByuid(int uid)
        {
            List <Order>     list  = _repository.GetOrdersByuid(uid);
            List <ViewOrder> model = new List <ViewOrder>();

            foreach (var item in list)
            {
                model.Add(ViewOrder.ToViewModel(item));
            }
            return(model);
        }
コード例 #6
0
        public List <ViewOrder> GetClassId(int UserId)
        {
            List <Order> list = _repository.GetClassId(UserId);

            List <ViewOrder> model = new List <ViewOrder>();

            foreach (var item in list)
            {
                model.Add(ViewOrder.ToViewModel(item));
            }
            return(model);
        }