protected void Page_Load(object sender, EventArgs e) { int officeId = -1; officeId = Convert.ToInt32(Request["officeId"]); Watch w = WatchDal.getWatchInfo(officeId); string jsonString = JsonConvert.SerializeObject(w); Response.Write(jsonString); }
public ActionResult GetWatchInfo(string officeId, string workDate) { StatusReport sr = new StatusReport(); if (string.IsNullOrEmpty(officeId) || string.IsNullOrEmpty(workDate)) { sr.status = "Fail"; sr.result = "数据不完整"; return(Json(sr)); } sr = WatchDal.getWatchInfo(officeId, workDate); return(Json(sr)); }