public ActionResult SearchByDate(InputOfKneadingCommandSearchViewModel model, GridSettings gridSettings) { if (string.IsNullOrEmpty(gridSettings.SortField)) { gridSettings.SortField = "F39_KndEptBgnDate"; gridSettings.SortOrder = SortOrder.Asc; } if (!model.Within.HasValue) { return(Json(new GridResponse <PdtPlnItem>(new List <PdtPlnItem>(), 0), JsonRequestBehavior.AllowGet)); } var current = DateTime.Now; current = new DateTime(current.Year, current.Month, current.Day, 0, 0, 0); var future = current.AddDays(model.Within ?? 0); future = new DateTime(future.Year, future.Month, future.Day, 23, 59, 59); var result = _inputOfKneadingCommandDomain.SearchCriteria(current, future, model.KndLine, gridSettings); if (!result.IsSuccess) { return(Json(null, JsonRequestBehavior.AllowGet)); } return(Json(result.Data, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { var model = new InputOfKneadingCommandSearchViewModel { Grid = InitiateKneadingComandsList(), GridSelected = InitiateSelectedKneadingCommandsList() }; return(View(model)); }