脚本:
后台:
using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Web.Services;public partial class AJAX_GetMsg : System.Web.UI.Page{ zab_HuiFang zhf = new zab_HuiFang(); zab_SheJiYQ zsj = new zab_SheJiYQ(); protected void Page_Load(object sender, EventArgs e) { DateTime now = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); //提示框高度 int height = 100; //客户回访数量 提早一天提示 int hfcount = 0; DataTable hfdt = zhf.GetHFTongji(" and hf_khTime >= '" + now.AddDays(1) + "' and hf_khTime < '" + now.AddDays(2) + "'"); if (hfdt != null) { hfcount = hfdt.Rows.Count; } //设计图纸提交数量 提早一天提示 int sjcount = 0; DataTable sjdt = zsj.GetSheJi(" and ((sj_timePm >= '" + now.AddDays(1) + "' and sj_timePm < '" + now.AddDays(2) + "' and sj_jiaoTuOneState = 1)" + " or (sj_timeXg >= '" + now.AddDays(1) + "' and sj_timeXg < '" + now.AddDays(2) + "' and sj_jiaoTuTwoState = 1)" + " or (sj_timeSg >= '" + now.AddDays(1) + "' and sj_timeSg < '" + now.AddDays(2) + "' and sj_jiaoTuThreeState = 1)" + " or (sj_timeQT >= '" + now.AddDays(1) + "' and sj_timeQT < '" + now.AddDays(2) + "' and sj_jiaoTuFourState = 1))"); if (sjdt != null) { sjcount = sjdt.Rows.Count; } string msg = string.Empty; if (hfcount != 0) { msg += "明天需要回访的客户有:" + hfcount + "个"; height += 30; } if (sjcount != 0) { msg += "明天需要提交的图纸有:" + sjcount + "个"; height += 30; } if (!string.IsNullOrEmpty(msg)) { msg += "时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "" + "■" + height; } Response.Write(msg); }}