// GET: Product public ActionResult Index() { SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient(); List <ProductDTO> model = new List <ProductDTO>(); model = client.GetProductAll(); client.Close(); return(View(model)); }
public JsonResult SaveProduct(ProductDTO productDTO) { productDTO.Price = 0; productDTO.CreateDate = DateTime.Now; productDTO.EditDate = DateTime.Now; productDTO.CreateUser = ((UserDTO)Session["userData"]).Username; productDTO.EditUser = ((UserDTO)Session["userData"]).Username; SedesolService.SedesolServiceClient client = new SedesolService.SedesolServiceClient(); productDTO = client.SaveProduct(productDTO); List <ProductDTO> listProduct = new List <ProductDTO>(); if (productDTO.Message == "SUCCESS") { listProduct = client.GetProductAll(); } client.Close(); string viewContent = ConvertViewToString("ProductList", listProduct); return(Json(new { message = productDTO.Message, PartialView = viewContent })); }