public void FindAllSendOrder() { string rows = Context.Request.Form["rows"]; string page = Context.Request.Form["page"]; string orderNo = Context.Request.Form["orderNo"]; string partsdrawing = Context.Request.Form["partsdrawing"]; string startTime = Context.Request.Form["startTime"]; string endTime = Context.Request.Form["endTime"]; int count = _bal.FindAllSendOrderCount(orderNo, partsdrawing); DataSet ds = _bal.FindAllSendOrder(orderNo, partsdrawing, rows, page); if (ds != null && ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { object ask = (ds.Tables[0].Rows[i]["ASK_QUANTITY"] == null || ds.Tables[0].Rows[i]["ASK_QUANTITY"].ToString() == "") ? 0 : ds.Tables[0].Rows[i]["ASK_QUANTITY"]; object outQty = (ds.Tables[0].Rows[i]["OUT_QUANTITY"] == null || ds.Tables[0].Rows[i]["OUT_QUANTITY"].ToString() == "") ? 0 : ds.Tables[0].Rows[i]["OUT_QUANTITY"]; ds.Tables[0].Rows[i]["ASK_QUANTITY"] = ask; ds.Tables[0].Rows[i]["OUT_QUANTITY"] = outQty; ds.Tables[0].Rows[i]["OUT_NOTICE_QTY"] = Convert.ToInt32(ask) - Convert.ToInt32(outQty); if (ds.Tables[0].Rows[i]["CREATED_BY"] != null) { ds.Tables[0].Rows[i]["CREATED_BY"] = FindUserNameByCode(ds.Tables[0].Rows[i]["CREATED_BY"].ToString()); } } } Dictionary <String, Object> map = new Dictionary <String, Object>(); //if (count > 0) //{ map.Add("total", count); map.Add("rows", ds.Tables[0]); //} Context.Response.Write(JsonConvert.SerializeObject(map)); }