protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oPage = new Pages(intProfile, dsn); oAppPage = new AppPages(intProfile, dsn); oResourceRequest = new ResourceRequest(intProfile, dsn); oUser = new Users(intProfile, dsn); if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } DateTime _date = DateTime.Today; lblTitle.Text = "Change Calendar for " + _date.ToLongDateString(); DataSet ds = oResourceRequest.GetChangeControlsDate(_date); rptView.DataSource = ds; rptView.DataBind(); lblNone.Visible = (rptView.Items.Count == 0); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oResourceRequest = new ResourceRequest(intProfile, dsn); oUser = new Users(intProfile, dsn); if (Request.QueryString["d"] != null && Request.QueryString["d"] != "") { DateTime _date = DateTime.Parse(Request.QueryString["d"]); strDay = _date.ToLongDateString(); DataSet ds = oResourceRequest.GetChangeControlsDate(_date); rptView.DataSource = ds; rptView.DataBind(); lblNone.Visible = (rptView.Items.Count == 0); } }
protected void DayRender(Object Sender, DayRenderEventArgs e) { e.Day.IsSelectable = false; if (e.Day.Date != calThis.SelectedDate) { e.Cell.Attributes.Add("onmouseover", "CalendarOver(this);"); e.Cell.Attributes.Add("onmouseout", "CalendarOut(this);"); } e.Cell.Attributes.Add("onclick", "ShowChanges('" + e.Day.Date.ToShortDateString() + "');"); e.Cell.ToolTip = e.Day.Date.ToLongDateString(); e.Cell.Text = "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\">"; if (e.Day.IsOtherMonth == false && e.Day.IsWeekend == false) { e.Cell.Text += "<tr><td class=\"calendarhead\">" + e.Day.DayNumberText + "</td></tr>"; } else { e.Cell.Text += "<tr><td class=\"calendarotherhead\">" + e.Day.DayNumberText + "</td></tr>"; } DataSet ds = oResourceRequest.GetChangeControlsDate(e.Day.Date); int intCount = 0; foreach (DataRow dr in ds.Tables[0].Rows) { if (intCount > intRows) { break; } string strName = dr["projectname"].ToString(); string strNumber = dr["projectnumber"].ToString(); string strChange = dr["number"].ToString(); int intUser = Int32.Parse(dr["userid"].ToString()); string strTime = DateTime.Parse(dr["implementation"].ToString()).ToShortTimeString(); e.Cell.Text += "<tr><td class=\"smallcalendar\"><a href=\"javascript:void(0);\" class=\"smallcalendar\" onclick=\"ShowChange('" + dr["changeid"].ToString() + "');\" title=\"Change Control: " + strChange + " Project Name:" + strName + " Project Number:" + strNumber + " Technician: " + oUser.GetFullName(intUser) + " Start Time: " + strTime + "\">" + strChange + " (" + oUser.GetName(intUser) + ")</a></td></tr>"; intCount++; } e.Cell.Text += "<tr><td class=\"smallcalendar\"><img src=\"/images/spacer.gif\" border=\"0\" width=\"150\" height=\"1\"/></td></tr>"; e.Cell.Text += "</table>"; }