public Result Add(ViewOrder order) { Order _order = ViewOrder.ToEntity(order); _order = _repository.Add(_order); return(new Result(0, "", ViewOrder.ToViewModel(_order))); }
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)); }
public ViewOrder Get(int id) { //Order order = _repository.Orders.FirstOrDefault(o => o.Id == id); Order order = _repository.Get(id); return(ViewOrder.ToViewModel(order)); }
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); }
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); }
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); }