using System; using System.Collections.Generic; //using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; // using System.Text; namespace Com.Jpsoft.Hospital.Web.Module.ExamineInfo.jp_examine_record { public partial class Detail : Com.Jpsoft.Hospital.Web.Common.BasePage { protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(Request.QueryString["act"].ToString())) { } else { string act = Request.QueryString["act"].ToString(); switch (act) { case"now": shownow(); break; case"yesterday": showyesterday(); break; case"month": month(); break; case"lastmonth": lastmonth(); break; case"jidu": jidu(); break; case"lastjidu": lastjidu(); break; case"year": year(); break; case"lastyear": lastyear(); break; } } } /// /// 今天 /// private void shownow() { string str = DateTime.Now.ToString("yyyy-MM-dd 00:00:00")+"&"+DateTime.Now.ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } /// /// 昨天 /// private void showyesterday() { string str = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd 00:00:00") + "&" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType="text/plain"; Response.Write(str); Response.End(); } /// /// 本月 /// private void month() { string str = DateTime.Now.ToString("yyyy-MM-01 00:00:00") + "&" + DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } /// /// 上月 /// private void lastmonth() { string str = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(-1).ToString("yyyy-MM-dd 00:00:00") + "&" + DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } /// /// 本季度 /// private void jidu() { string str = DateTime.Now.AddMonths(0 - ((DateTime.Now.Month - 1) % 3)).ToString("yyyy-MM-01 00:00:00") + "&" + DateTime.Parse(DateTime.Now.AddMonths(3 - ((DateTime.Now.Month - 1) % 3)).ToString("yyyy-MM-01")).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } /// /// 上季度 /// private void lastjidu() { string str = DateTime.Now.AddMonths(-3 - ((DateTime.Now.Month - 1) % 3)).ToString("yyyy-MM-01 00:00:00")+ "&" + DateTime.Parse(DateTime.Now.AddMonths(0 - ((DateTime.Now.Month - 1) % 3)).ToString("yyyy-MM-01")).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } /// /// 本年度 /// private void year() { string str = DateTime.Parse(DateTime.Now.ToString("yyyy-01-01")).ToString("yyyy-MM-dd 00:00:00") + "&" + DateTime.Parse(DateTime.Now.ToString("yyyy-01-01")).AddYears(1).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } /// /// 上年度 /// private void lastyear() { string str = DateTime.Parse(DateTime.Now.ToString("yyyy-01-01")).AddYears(-1).ToString("yyyy-MM-dd 00:00:00") + "&" + DateTime.Parse(DateTime.Now.ToString("yyyy-01-01")).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); Response.ContentType = "text/plain"; Response.Write(str); Response.End(); } } }