void lbtnDelete_Command(object sender, CommandEventArgs e) { var validationErrors = new ENTValidationErrors(); var holiday = new HolidayEO(); holiday.DBAction = ENTBaseEO.DBActionEnum.Delete; holiday.ID = Convert.ToInt32(e.CommandArgument); holiday.Delete(ref validationErrors, CurrentUser.ID); Master.ValidationErrors = validationErrors; cgvHolidays.DataBind(); }
private void SetHolidayCell(DayRenderEventArgs e, HolidayEO holiday) { e.Day.IsSelectable = false; e.Cell.Controls.Add(new LiteralControl("<br />")); Label lbl = new Label(); lbl.Text = "H"; lbl.Font.Size = 6; e.Cell.Controls.Add(lbl); e.Cell.ToolTip = holiday.HolidayName; e.Cell.BackColor = Color.LightSkyBlue; }
protected void calFullDay_DayRender(object sender, DayRenderEventArgs e) { if (calFullDay.SelectedDate == e.Day.Date) { SetPTORequestCellText(e, e.Day.Date, (PTORequestTypeBO.PTORequestTypeEnum)Convert.ToInt32(ddlPTORequestType.SelectedValue), (PTODayTypeBO.PTODayTypeEnum)Convert.ToInt32(ddlPTODayType.SelectedValue), Color.LightGreen); //check if there is another request for this day. This could happen if the user requested two half //days on the same day. List <PTORequestEO> ptoRequests = _priorDaysOff.GetByRequestDate(e.Day.Date); if (ptoRequests.Count != 0) { foreach (PTORequestEO ptoRequest in ptoRequests) { SetPTORequestCellText(e, e.Day.Date, ptoRequest.PTORequestTypeId, ptoRequest.PTODayTypeId, Color.LightGreen); } } } else { if (e.Day.Date.IsWeekend()) { e.Day.IsSelectable = false; } else { HolidayEO holiday = _holidays.GetHoliday(e.Day.Date); if (holiday != null) { SetHolidayCell(e, holiday); } else { List <PTORequestEO> ptoRequests = _priorDaysOff.GetByRequestDate(e.Day.Date); if (ptoRequests.Count != 0) { foreach (PTORequestEO ptoRequest in ptoRequests) { SetPriorPTOCell(e, ptoRequest); } if (ptoRequests.Count > 1) { e.Day.IsSelectable = false; } } } } } }