protected void btnApprove_Click(Object Sender, EventArgs e) { int intVacation = Int32.Parse(lblVacation.Text); oVacation.Update(intVacation, 1); int intUser = Int32.Parse(oVacation.Get(intVacation, "userid")); oFunction.SendEmail("ClearView Out of Office Request", oUser.GetName(intUser), "", strEMailIdsBCC, "ClearView Out of Office Request", "<p><b>The following out of office request has been APPROVED by your MANAGER (" + oUser.GetFullName(intProfile) + ")</b><p><p>" + oVacation.GetBody(intVacation, intEnvironment) + "</p>", true, false); Response.Redirect(oPage.GetFullLink(intPage) + "?action=finish"); }
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); oVacation = new Vacation(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 = "Out of Office Calendar for " + _date.ToLongDateString(); ds = oVacation.Get(_date, intApplication); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["vacation"].ToString() == "1") { dr["reason"] = "Vacation"; } else if (dr["holiday"].ToString() == "1") { dr["reason"] = "Floating Holiday"; } else if (dr["personal"].ToString() == "1") { dr["reason"] = "Personal / Sick Day"; } if (dr["morning"].ToString() == "1") { dr["duration"] = "Morning"; } else if (dr["afternoon"].ToString() == "1") { dr["duration"] = "Afternoon"; } else { dr["duration"] = "Full Day"; } } rptView.DataSource = ds; rptView.DataBind(); lblNone.Visible = (ds.Tables[0].Rows.Count == 0); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); int intApplication = 0; oVacation = new Vacation(intProfile, dsn); if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["d"] != null && Request.QueryString["d"] != "" && intApplication > 0) { DateTime _date = DateTime.Parse(Request.QueryString["d"]); ds = oVacation.Get(_date, intApplication); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["vacation"].ToString() == "1") { dr["reason"] = "Vacation"; } else if (dr["holiday"].ToString() == "1") { dr["reason"] = "Floating Holiday"; } else if (dr["personal"].ToString() == "1") { dr["reason"] = "Personal / Sick Day"; } if (dr["morning"].ToString() == "1") { dr["duration"] = "Morning"; } else if (dr["afternoon"].ToString() == "1") { dr["duration"] = "Afternoon"; } else { dr["duration"] = "Full Day"; } } rptView.DataSource = ds; rptView.DataBind(); lblDate.Text = _date.ToLongDateString(); } }
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", "DateSelect('" + e.Day.Date.ToShortDateString() + "');"); e.Cell.ToolTip = e.Day.Date.ToLongDateString(); if (boolAll == false) { e.Cell.Text = "<div style=\"width:100%;height:80;overflow:hidden\">"; } else { e.Cell.Text = "<div style=\"width:100%;height:100%;overflow:visible\">"; } e.Cell.Text += "<table width=\"100%\" 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>"; } ds = oHoliday.Get(e.Day.Date); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { e.Cell.Text += "<tr><td class=\"calendarred\">" + dr["name"].ToString() + "</span></td></tr>"; } } else { ds = oVacation.Get(e.Day.Date, intApplication); int intCount = 0; if (ds.Tables[0].Rows.Count > 0) { while (intCount < ds.Tables[0].Rows.Count && intCount < intRows) { string strType = ""; string strReason = ds.Tables[0].Rows[intCount]["reason"].ToString(); if (ds.Tables[0].Rows[intCount]["vacation"].ToString() == "1") { strType = "V:"; strReason = "Vacation"; } else if (ds.Tables[0].Rows[intCount]["holiday"].ToString() == "1") { strType = "F:"; strReason = "Floating Holiday"; } else if (ds.Tables[0].Rows[intCount]["personal"].ToString() == "1") { strType = "P:"; strReason = "Personal / Sick day"; } else if (strReason == "Highland Hills") { strType = "HH:"; } if (e.Day.IsOtherMonth == false && e.Day.IsWeekend == false) { e.Cell.Text += "<tr><td class=\"calendar\"><span title=\"" + ds.Tables[0].Rows[0]["username"].ToString() + " " + strReason + " " + e.Day.Date.ToString("MMMM dd, yyyy") + "\">" + strType + ds.Tables[0].Rows[intCount]["username"].ToString() + "</span></td></tr>"; } else { e.Cell.Text += "<tr><td class=\"calendarother\"><span title=\"" + ds.Tables[0].Rows[0]["username"].ToString() + " " + strReason + " " + e.Day.Date.ToString("MMMM dd, yyyy") + "\">" + strType + ds.Tables[0].Rows[intCount]["username"].ToString() + "</span></td></tr>"; } intCount++; } } } e.Cell.Text += "</table>"; //if (boolAll == false) e.Cell.Text += "</div>"; }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oVacation = new Vacation(intProfile, dsn); oPage = new Pages(intProfile, dsn); oUser = new Users(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oVariable = new Variables(intEnvironment); if (Request.QueryString["action"] != null && Request.QueryString["action"] != "") { panFinish.Visible = true; } else { 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); } int intVacation = 0; if (!IsPostBack) { if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intVacation = Int32.Parse(Request.QueryString["id"]); lblVacation.Text = Request.QueryString["id"]; int intRequester = Int32.Parse(oVacation.Get(intVacation, "userid")); if (intVacation > 0) { if (oUser.IsManager(intRequester, intProfile, true)) { panRequest.Visible = true; strBody = oVacation.GetBody(intVacation, intEnvironment); } else { panDenied.Visible = true; } } else { panDenied.Visible = true; } } else { panDenied.Visible = true; } } } btnClose.Attributes.Add("onclick", "return CloseWindow();"); btnFinish.Attributes.Add("onclick", "return CloseWindow();"); btnApprove.Attributes.Add("onclick", "return confirm('Are you sure you want to APPROVE this request?');"); btnDeny.Attributes.Add("onclick", "return confirm('Are you sure you want to DENY this request?');"); }