📄 plan.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace eOA
{
/// <summary>
/// test 的摘要说明。
/// </summary>
public class test : System.Web.UI.Page
{
private static DateTime date = new DateTime();
protected System.Web.UI.WebControls.Calendar Calendar1;
private void Page_Load(object sender, System.EventArgs e)
{
date = DateTime.Now;
// txtYear.Text = date.Year.ToString();
// dropMonth.SelectedIndex = date.Month - 1;
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Calendar1.DayRender += new System.Web.UI.WebControls.DayRenderEventHandler(this.Calendar1_DayRender_1);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Calendar1_DayRender_1(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
CalendarDay d = e.Day;
TableCell c = e.Cell;
if (d.IsOtherMonth)
{
c.Controls.Clear();
}
else
{
try
{
HyperLink aHyperLink = new HyperLink();
aHyperLink.ImageUrl ="C:\\Inetpub\\wwwroot\\eOA\\img\\addplan.gif";
aHyperLink.ToolTip = "新增个人日程";
aHyperLink.NavigateUrl = "planaddup.aspx?day="+d.Date.ToShortDateString();
c.Controls.Add(new LiteralControl(" "+" "+" "+" "));
c.Controls.Add(aHyperLink);
c.Controls.Add(new LiteralControl("<br>"));
}
catch
{
}
DateTime FDate = new DateTime();
string Subject;
SqlDataReader myDR;
DateTime Date = new DateTime();
Date = d.Date;
Plan myPlan=new Plan();
myDR=myPlan.GetAllPlan (Convert.ToInt16(Session["UserID"]),Date);
try
{
while(myDR.Read())
{
int ID = Int32.Parse(myDR.GetInt32(0).ToString());
FDate = DateTime.Parse(myDR.GetSqlDateTime(4).ToString());
Subject = myDR.GetValue(2).ToString();
if(Subject.Length > 4)
{
Subject = Subject.Substring(0,4);
Subject += "...";
}
HtmlAnchor a = new HtmlAnchor();
a.HRef = "planitem.aspx?day="+d.Date.ToShortDateString()+"&id="+ID;
a.InnerText = "!"+Subject+"";
c.Controls.Add(new LiteralControl(" "+" "+" "+" "));
c.Controls.Add(new LiteralControl("<br>"));
c.Controls.Add(a);
c.Controls.Add(new LiteralControl("<br>"));
}
myDR.Close();
}
catch
{
}
}
e.Cell.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#fff7ce';cursor='hand';";
e.Cell.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#ffffff';";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -