public JsonResult AJXSearchShipment() { string keyword = !string.IsNullOrEmpty(Request.Form["SearchKeyword"]) ? Request.Form["SearchKeyword"] : null; string fromdate = Request.Form["fromdate"]; string todate = Request.Form["todate"]; DateTime dtmFromdate = !string.IsNullOrEmpty(fromdate) ? DateTime.Parse(fromdate) : DateTime.Now.AddDays(-30); DateTime dtmTodate = !string.IsNullOrEmpty(todate) ? DateTime.Parse(todate) : DateTime.Now; var lsShipment = _shipmentService.Admin_SearchShipmentByCondition(keyword, dtmFromdate, dtmTodate); var result = GetPositionWithModel(lsShipment, dtmFromdate, dtmTodate); ListShipmentModels lsResult = new ListShipmentModels() { ListResult = result, FromDate = dtmFromdate, ToDate = dtmTodate }; return(Json(RenderPartialViewToString("_GridShipment", lsResult), JsonRequestBehavior.AllowGet)); }