public JsonResult EditSysConfig(sysConfig sys) { bool status = true; bool check = true; string msg = ""; if (sys.stockUpdate == DateTime.MinValue) { check = false; } if (sys.otcUpdate == DateTime.MinValue) { check = false; } if (sys.nowDate == DateTime.MinValue) { check = false; } if (sys.avgStartDate == DateTime.MinValue) { check = false; } if (sys.avgEndDate == DateTime.MinValue) { check = false; } if (check) { status = reportModel.EditSysConfig(sys); msg = status ? "更新成功!" : "更新失敗!"; } else { status = false; msg = "資料輸入錯誤!"; } return(Json(new Results <DBNull> { Success = status, Message = msg, Data = null, TotalCount = status ? 1 : 0 })); }