public JsonResult GetMaxSINo() { var result = _localPurchaseService.GetAllLocalPurchase().Select(m => m.ShippingInstruction.Value); var siList = result.Select(si => Regex.Match(si, @"\d+").Value).Select(data => Convert.ToInt32(data)).ToList(); int resultInt = siList.Max() + 1; return(Json("LP-" + resultInt, JsonRequestBehavior.AllowGet)); }
public ActionResult LocalPurchase_Read([DataSourceRequest] DataSourceRequest request) { var localPurchase = _localPurchaseService.GetAllLocalPurchase().OrderByDescending(m => m.LocalPurchaseID).ToList(); var localPurchseToDisplay = GetLocalPurchase(localPurchase); return(Json(localPurchseToDisplay.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }