protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { if (e.Appointment.Resources.Count < 1) { e.Appointment.Resources.Add(RadScheduler1.Resources.GetResource("Calendar", "1")); } }
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { // Eliminar la cita int id = (int)e.Appointment.ID; appointment = CntAriCli.GetAppointment(id, ctx); ctx.Delete(appointment); ctx.SaveChanges(); RadAjaxManager1.ResponseScripts.Add("refreshScheduler();"); }
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { if (Convert.ToInt32(e.Appointment.Attributes["UserId"]) == StoredData.User.UserId && string.IsNullOrEmpty(e.Appointment.RecurrenceRule)) { ViewState["DeletedAppointment"] = e.Appointment; RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(@"radconfirm('If you are trying to delete this match within 5 hours of the scheduled time, your opponent can claim a walkover. Which can result in 2 penalty points against you.<br><br>Do you want to continue?',confirmCallBackDelete);"); } else { e.Cancel = true; } }
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { using (var context = new UzoneEntities()) { Scheduler _scheduler; _scheduler = context.Schedulers.Find(e.Appointment.ID); if (_scheduler != null) { context.Schedulers.Remove(_scheduler); context.SaveChanges(); } } }
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { try { lblMsg.Text = string.Empty; int iID = Convert.ToInt32(e.Appointment.ID); BEStudent objBEStudent = new BEStudent(); objBEStudent.IntTransID = iID; objBEStudent.IntUserID = Convert.ToInt32(Session[EnumPageSessions.USERID]); BStudent objBStudent = new BStudent(); objBStudent.BDeleteAppointment(objBEStudent); Bind_GetBookedExamSlots(); if (objBEStudent.DtResult.Rows.Count > 0 && objBEStudent.DtResult != null) { if (Convert.ToInt32(objBEStudent.DtResult.Rows[0]["Result"]) != 1) { lblMsg.Text = "<img src='../Images/no.png'align='middle'/> <font color='red'>" + Resources.ResMessages.AppointmentDelete + "</font>"; } else { lblMsg.Text = "<img src='../Images/yes.png'align='middle'/> <font color='#00C000'>" + "Exam (Exam ID: " + iID + ")" + Resources.ResMessages.AppointmentDeleteSuccess + "</font>"; try { BEMail objBEMail = new BEMail(); BMail objBMail = new BMail(); objBEMail.IntUserID = 0; objBEMail.IntTransID = Convert.ToInt64(iID.ToString()); objBEMail.StrTemplateName = BaseClass.EnumEmails.ExamCancelConfirmation.ToString(); objBMail.BSendEmail(objBEMail); } catch (Exception ex) { throw ex; } } } } catch (Exception ex) { throw ex; } }
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Scheduler _scheduler = new Scheduler(); _scheduler.EventStart = e.Appointment.Start; _scheduler.EventEnd = e.Appointment.End; _scheduler.EventDescription = e.Appointment.Description; _scheduler.EventSubject = e.Appointment.Subject; _scheduler.SchoolID = (long)Session["currentSchoolID"]; if (e.Appointment.Resources.FirstOrDefault() != null) _scheduler.EventLocationID = (int)e.Appointment.Resources.First().Key; using (var context = new UzoneEntities()) { context.Schedulers.Add(_scheduler); context.SaveChanges(); LoadScheduler(); } }
/// <summary> /// Handles the AppointmentDelete event of the RadScheduler1 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerCancelEventArgs"/> instance containing the event data.</param> protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { Appointments.Remove(FindById(e.Appointment.ID)); }
/// <summary> /// Handles the AppointmentInsert event of the RadScheduler1 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerCancelEventArgs"/> instance containing the event data.</param> protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Appointments.Add(new AppointmentObj(e.Appointment)); }
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { if (e.Appointment.Resources.Count < 1) e.Appointment.Resources.Add(RadScheduler1.Resources.GetResource("Calendar", "1")); }
protected void radAppointment_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { var taskManager = new TaskManager(this); taskManager.DeleteTask(Convert.ToInt32(e.Appointment.ID)); }
/// <summary> /// Handles the AppointmentInsert event of the RadScheduler1 control. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerCancelEventArgs" /> instance containing the event data.</param> protected void _rsReservations_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Appointments.Add(new AppointmentObj(e.Appointment)); }
protected void tkrsNonWorkingDays_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Page.Validate(); if (Page.IsValid) { string filterExpression = string.Format("Deleted = 0 AND StartDate = '{0}'", e.Appointment.Start); DataRow[] drarray = vacationsNonWorkingDaysInformationTDS.NonWorkingDaysInformation.Select(filterExpression, "StartDate ASC", DataViewRowState.CurrentRows); if (drarray.Length == 0) { VacationsNonWorkingDaysInformation vacationsNonWorkingDaysInformation = new VacationsNonWorkingDaysInformation(vacationsNonWorkingDaysInformationTDS); vacationsNonWorkingDaysInformation.Insert(e.Appointment.Start, Int32.Parse(ddlWorkingLocation.SelectedValue), e.Appointment.Subject, false, Int32.Parse(hdfCompanyId.Value), false); // Store dataset Session["vacationsNonWorkingDaysInformationTDS"] = vacationsNonWorkingDaysInformationTDS; Session["nonWorkingDaysInformation"] = vacationsNonWorkingDaysInformationTDS.NonWorkingDaysInformation; tkrsNonWorkingDays.DataBind(); } else { e.Cancel = true; ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You already have a non working day for this day please verify your data.');", true); } } else { e.Cancel = true; } }
protected void tkrsNonWorkingDays_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { Page.Validate(); if (Page.IsValid) { int nonWorkingDayId = Convert.ToInt32(e.Appointment.ID); VacationsNonWorkingDaysInformation vacationsNonWorkingDaysInformation = new VacationsNonWorkingDaysInformation(vacationsNonWorkingDaysInformationTDS); vacationsNonWorkingDaysInformation.Delete(nonWorkingDayId); // Store dataset Session["vacationsNonWorkingDaysInformationTDS"] = vacationsNonWorkingDaysInformationTDS; Session["nonWorkingDaysInformation"] = vacationsNonWorkingDaysInformationTDS.NonWorkingDaysInformation; tkrsNonWorkingDays.DataBind(); } else { e.Cancel = true; } }
protected void tkrsVacations_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { Page.Validate(); if (Page.IsValid) { // Validate if the user can delete older vacations if ((!(Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_VACATIONS_FULL_EDITING"]))) && (e.Appointment.Start < DateTime.Now)) { e.Appointment.AllowDelete = false; ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You can not delete older vacations. Please contact your system adminitrator.');", true); e.Cancel = true; } else { int vacationId = Convert.ToInt32(e.Appointment.ID); double takenDay = 0; VacationsInformationDaysInformationGateway vacationsInformationDaysInformationGateway = new VacationsInformationDaysInformationGateway(vacationsInformationTDS); string oldPaymentType = vacationsInformationDaysInformationGateway.GetPaymentType(vacationId); switch (oldPaymentType) { case "Half Vacation Day": takenDay = 0.5; break; case "Full Vacation Day": takenDay = 1; break; } VacationsInformationDaysInformation vacationsInformationDaysInformation = new VacationsInformationDaysInformation(vacationsInformationTDS); vacationsInformationDaysInformation.Delete(vacationId); double newRemainingVacationDays = double.Parse(tbxRemaining.Text) + takenDay; tbxRemaining.Text = newRemainingVacationDays.ToString(); // Store dataset Session["vacationsInformationTDS"] = vacationsInformationTDS; Session["vacationDaysInformation"] = vacationsInformationTDS.DaysInformation; tkrsVacations.DataBind(); } } else { e.Cancel = true; } }
protected void tkrsVacations_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Page.Validate(); if (Page.IsValid) { string filterExpression = string.Format("Deleted = 0 AND StartDate = '{0}'", e.Appointment.Start); DataRow[] drarray = vacationsInformationTDS.DaysInformation.Select(filterExpression, "StartDate ASC", DataViewRowState.CurrentRows); bool isValidVacation = true; switch (e.Appointment.Subject) { case "Half Vacation Day": if (drarray.Length > 0) { if ((drarray[0]["PaymentType"].ToString() != "Half Vacation Day") && (drarray[0]["PaymentType"].ToString() != "Unpaid Leave Half Day")) { isValidVacation = false; } else { if (drarray.Length > 1) { isValidVacation = false; } } } break; case "Full Vacation Day": if (drarray.Length > 0) { isValidVacation = false; } break; case "Unpaid Leave Full Day": if (drarray.Length > 0) { isValidVacation = false; } break; case "Unpaid Leave Half Day": if (drarray.Length > 0) { if ((drarray[0]["PaymentType"].ToString() != "Unpaid Leave Half Day") && (drarray[0]["PaymentType"].ToString() != "Half Vacation Day")) { isValidVacation = false; } else { if (drarray.Length > 1) { isValidVacation = false; } } } break; } // Verify non working days if (isValidVacation) { isValidVacation = LiquiForce.LFSLive.BL.LabourHours.ProjectTime.ProjectTime.ValidateIfNonWorkingDay(e.Appointment.Start, Int32.Parse(hdfEmployeeId.Value), Int32.Parse(hdfCompanyId.Value)); if (!isValidVacation) { e.Cancel = true; ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You can not take vacations on this day, this is a non working day. Please verify your data.');", true); } else { // Verify existent vacations isValidVacation = LiquiForce.LFSLive.BL.LabourHours.ProjectTime.ProjectTime.ValidateIfExistsAVacation(e.Appointment.Start, Int32.Parse(hdfEmployeeId.Value), Int32.Parse(hdfCompanyId.Value)); if (!isValidVacation) { e.Cancel = true; ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You have a vacation planned for this day. Please verify your data.');", true); } else { VacationsInformationGateway vacationsInformationGateway = new VacationsInformationGateway(); int amountHalfDays = vacationsInformationGateway.IsHalfVacationDay(e.Appointment.Start, Int32.Parse(hdfEmployeeId.Value), Int32.Parse(hdfCompanyId.Value)); if (amountHalfDays > 0) { if ((e.Appointment.Subject == "Unpaid Leave Full Day") || (e.Appointment.Subject == "Full Vacation Day")) { isValidVacation = false; e.Cancel = true; ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You have a half vacation day planned for this day. Please verify your data.');", true); } } } } } else { e.Cancel = true; ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You already have a vacation request for this day please verify your data.');", true); } if (isValidVacation) { double takenDay = 0; switch (e.Appointment.Subject) { case "Half Vacation Day": takenDay = 0.5; break; case "Full Vacation Day": takenDay = 1; break; } VacationsInformationDaysInformation vacationsInformationDaysInformation = new VacationsInformationDaysInformation(vacationsInformationTDS); vacationsInformationDaysInformation.Insert(Int32.Parse(hdfRequestId.Value), e.Appointment.Start, e.Appointment.Start, e.Appointment.Subject, e.Appointment.Subject, false, Int32.Parse(hdfCompanyId.Value)); // Store dataset Session["vacationsInformationTDS"] = vacationsInformationTDS; Session["vacationDaysInformation"] = vacationsInformationTDS.DaysInformation; tkrsVacations.DataBind(); double newRemainingVacationDays = double.Parse(tbxRemaining.Text) - takenDay; tbxRemaining.Text = newRemainingVacationDays.ToString(); if (double.Parse(tbxRemaining.Text) < 0) { ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('You are requesting more vacation than the entitlement. If you continue this days will be discounted from next years total.');", true); } } } else { e.Cancel = true; } }
/// <summary> /// Handles the AppointmentDelete event of the RadScheduler1 control. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerCancelEventArgs" /> instance containing the event data.</param> protected void _rsReservations_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { Appointments.Remove(FindById(e.Appointment.ID)); }
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { return; // Eliminar la cita //int id = (int)e.Appointment.ID; //appointment = CntAriCli.GetAppointment(id, ctx); //ctx.Delete(appointment); //ctx.SaveChanges(); //RadAjaxManager1.ResponseScripts.Add("refreshScheduler();"); }
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { RadCalendar1.SpecialDays.Clear(); RadCalendar2.SpecialDays.Clear(); }
/// <summary> /// Handles the AppointmentInsert event of the _rsReservations control. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerCancelEventArgs" /> instance containing the event data.</param> protected void _rsReservations_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Appointments.Add(new AppointmentObj(e.Appointment)); }
/// <summary> /// Handles the AppointmentDelete event of the _rsReservations control. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerCancelEventArgs" /> instance containing the event data.</param> protected void _rsReservations_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { Appointments.Remove(FindById(e.Appointment.ID)); }
protected void tkrsVacations_AppointmentDelete(object sender, SchedulerCancelEventArgs e) { Page.Validate(); if (Page.IsValid) { int vacationId = Convert.ToInt32(e.Appointment.ID); double takenDay = 0; VacationsAddDaysInformationGateway vacationsAddDaysInformationGateway = new VacationsAddDaysInformationGateway(vacationsAddTDS); string oldPaymentType = vacationsAddDaysInformationGateway.GetPaymentType(vacationId); switch (oldPaymentType) { case "Half Vacation Day": takenDay = 0.5; break; case "Full Vacation Day": takenDay = 1; break; } VacationsAddDaysInformation vacationsAddDaysInformation = new VacationsAddDaysInformation(vacationsAddTDS); vacationsAddDaysInformation.Delete(vacationId); double newRemainingVacationDays = double.Parse(tbxRemaining.Text) + takenDay; tbxRemaining.Text = newRemainingVacationDays.ToString(); // Store dataset Session["vacationsAddTDS"] = vacationsAddTDS; Session["vacationDaysInformation"] = vacationsAddTDS.DaysInformation; tkrsVacations.DataBind(); } else { e.Cancel = true; } }
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { e.Appointment.Attributes["Subject"] = e.Appointment.Subject; }