<%@ WebHandler Language="C#" Class="CheckPriKey" %> using System; using System.Collections.Generic; using System.Web; using System.Data; using System.IO; using eMIS.Data; using System.Data.Common; using System.Text; using System.Web.SessionState; using eMIS; public class CheckPriKey : IHttpHandler, IRequiresSessionState { public void ProcessRequest (HttpContext context) { string programId = context.Request.QueryString["pid"].ToString(); string y = context.Request.QueryString["y"].ToString(); string m = context.Request.QueryString["m"].ToString(); string desc = context.Request.QueryString["desc"].ToString(); string table = context.Request.QueryString["table"].ToString(); string tk = context.Request.QueryString["tk"].ToString(); string pk = context.Request.QueryString["pk"].ToString(); string t1 = y + "-" + m + "-1 00:00:00"; DateTime d1 = DateTime.Parse(t1); string t2 = d1.AddMonths(1).ToString("yyyy-MM-dd 00:00:00"); string days = DateTime.DaysInMonth(d1.Year, d1.Month).ToString(); StringBuilder sb = new StringBuilder(); DataManager dm = new DataManager(); DbDataReader reader = dm.ExecuteReader("select "+pk+"," +tk+","+ desc + " from " + table + " where '"+t1+"'<"+tk+" and "+ tk+"<'"+t2+"' order by "+tk); sb.Append("[{}"); while (reader.Read()) { sb.Append(",{pk:'"+reader[pk].ToString() +"',time:'"+reader[tk].ToString()+"',desc:'"+reader[desc].ToString()+"'}"); } reader.Close(); sb.Append("]"); context.Response.Write(sb.ToString()); } public bool IsReusable { get { return false; } } }