public ActionResult ShowPic(int id) { ProductLModel viewModel = new ProductLModel(); ProductViewModel employeeViewModel = new ProductViewModel(this, viewModel); viewModel = employeeViewModel.DBuild(id); byte[] imageData = viewModel.Product.LargePhoto; return(File(imageData, "image/gif")); }
public ActionResult Details(int Productid) { ProductLModel viewModel = new ProductLModel(); ProductViewModel employeeViewModel = new ProductViewModel(this, viewModel); viewModel = employeeViewModel.DBuild(Productid); return(View(viewModel)); }
// GET: Product public ActionResult Index(string searchString) { ProductLModel viewModel = new ProductLModel(); ProductViewModel productViewer = new ProductViewModel(this, viewModel); viewModel = productViewer.Build(); var ProductRes = viewModel.ProductList; if (!String.IsNullOrEmpty(searchString)) { viewModel.ProductList = ProductRes.Where(str => str.Name5.IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0); } return(View(viewModel)); }
public ProductViewModel(ProductController controller, ProductLModel viewModel) { }