private string GetSuccessInputResponse(int productId) { Product selectedProduct = DatabaseDAL.GetProductByProductID(productId); return(string.Format("This product is added to cart: {0}; {1}; {2:C}", selectedProduct.Name, selectedProduct.Description, selectedProduct.Price)); }
public ActionResult GetStates(JqGridSettings gridSettings) { var states = DatabaseDAL.GetAllStates(); var stateList = new List <State>(); foreach (var state in states) { stateList.Add(state); } int totalPages; int totalRecords; var allStates = stateList.AsQueryable(); var results = jqGridDataManager.GetGridData <State>(gridSettings, allStates, out totalPages, out totalRecords); JqGridResult result = new JqGridResult() { Page = gridSettings.PageIndex, Records = totalRecords, Total = totalPages, Rows = results.ToList() }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult GetCustomers(JqGridSettings gridSettings) { int totalPages; int totalRecords; var allProducts = DatabaseDAL.GetAllProductModels(); var results = jqGridDataManager.GetGridData <ProductModel>(gridSettings, allProducts, out totalPages, out totalRecords); JqGridResult result = new JqGridResult() { Page = gridSettings.PageIndex, Records = totalRecords, Total = totalPages, Rows = results.ToList() }; return(Json(result, JsonRequestBehavior.AllowGet)); }