FullCalendar3.8事件显示

Event_view.ashx

内容

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Web.Script.Serialization;
using System.Text;

namespace AppTask
{
    /// <summary>
    /// taskview 的摘要说明
    /// </summary>
    public class task_view : IHttpHandler
    {
        public static SqlConnection AppConn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Default"].ToString());
        public void ProcessRequest(HttpContext context)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            Dictionary<string, string> drow = new Dictionary<string, string>();
            List<Dictionary<string, object>> gas = new List<Dictionary<string, object>>();
            string start = System.Web.HttpUtility.UrlDecode(context.Request["start"], Encoding.UTF8);

            string end = System.Web.HttpUtility.UrlDecode(context.Request["end"], Encoding.UTF8);
            //SqlConnection con = new SqlConnection(@"Password=tac26901333;Persist Security Info=True;User ID=sa;Initial Catalog=DocumentManagement;Data Source=.");

            string eventStr = "SELECT [ID],[atuser],[attypename],[attitle],[atcontent],[atallday],[atsdate]" +
                             ",[atedate],[aturl],[atclassname],[ateditable],[atsource]" +
                             ",[atcolor],[atbgcolor],[atbdcolor],[attextcolor],[Remark]" +
                             ",[atguid],[CreateUser],[CreateTime],[ModiUser],[ModiTime]" +
                             " FROM[AppCube].[dbo].[atTasks] where '" + start + "'<atsdate and atsdate<'" + end + "'";
            SqlDataAdapter eventDA = new SqlDataAdapter(eventStr, AppConn);
            DataSet eventDS = new DataSet();
            eventDA.Fill(eventDS);
            AppConn.Close();
            for (int i = 0; i < eventDS.Tables[0].Rows.Count; i++)
            {
                Dictionary<string, object> drow2 = new Dictionary<string, object>();
                //事件ID删除用
                drow2.Add("id", eventDS.Tables[0].Rows[i]["ID"].ToString());
                //事件内容
                drow2.Add("title", eventDS.Tables[0].Rows[i]["attitle"].ToString());
                drow2.Add("description", eventDS.Tables[0].Rows[i]["atcontent"].ToString());
                //事件类别
                drow2.Add("attype", eventDS.Tables[0].Rows[i]["attypename"].ToString());
                //时间
                drow2.Add("start", eventDS.Tables[0].Rows[i]["atsdate"].ToString());
                drow2.Add("end", eventDS.Tables[0].Rows[i]["atedate"].ToString());
                //操作
                drow2.Add("editable", eventDS.Tables[0].Rows[i]["ateditable"].ToString());
                drow2.Add("allDay", eventDS.Tables[0].Rows[i]["atallday"]);
                //事件颜色区分
                //drow2.Add("color", eventDS.Tables[0].Rows[i]["atcolor"].ToString());//DarkGreen 
                drow2.Add("backgroundColor", eventDS.Tables[0].Rows[i]["atcolor"].ToString());//DarkGreen
                drow2.Add("borderColor", eventDS.Tables[0].Rows[i]["atcolor"].ToString());//White 

                drow2.Add("textColor", eventDS.Tables[0].Rows[i]["attextcolor"].ToString());//GhostWhite  
                //drow2.Add("eventColor", eventDS.Tables[0].Rows[i]["atcolor"].ToString());
                //drow2.Add("eventTextColor", eventDS.Tables[0].Rows[i]["attextcolor"].ToString());

                gas.Add(drow2);

            }
            context.Response.Write(jss.Serialize(gas));


        }


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值