private IList <Product> PopulateProductINformation(IList <Product> product, List <Order> orders)
 {
     foreach (var item in orders)
     {
         product.Add(_product.GetByID(item.SubjectID));
     }
     return(product);
 }
Example #2
0
        public ActionResult Details(int id)
        {
            OrderVM model  = new OrderVM();
            Product entity = _product.GetByID(id);

            model.Code        = entity.Code;
            model.Description = entity.Description;
            model.Price       = entity.Price;
            model.Title       = entity.Title;
            model.FromtImage  = entity.Image;

            int quantity = entity.Quantity;
            GenericSelectedList <Order> listUser = new GenericSelectedList <Order>();

            model.Quantity = listUser.GetSelectedListIthemQuantity(quantity);
            List <Images> listImg = _image.GetAll(x => x.Subject_id == id);

            foreach (var item in listImg)
            {
                model.Image.Add(item.Path);
            }


            return(View(model));
        }