예제 #1
0
 protected void radcalendar_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
 {
     if (e.Appointment.ID != null)
     {
         /*switch (e.Appointment.Attributes["EventTypeID"].ToString())
          * {
          *  case "999":
          *  case "7":
          *  case "8":
          *      if (e.Appointment.ID != null)
          *      {
          *          if (e.Appointment.Attributes["EventTypeID"].ToString() == "7" || e.Appointment.Attributes["EventTypeID"].ToString() == "8")
          *          {
          *              if ((e.Appointment.RecurrenceParentID == null) && e.Appointment.Attributes["EventTypeID"].ToString() != "999")
          *              {
          *                  e.Cancel = true;
          *                  Response.Redirect("IPAM_Workshops/IPAMWorkshops_Workshop_EventInformation.aspx?eid=" + e.Appointment.ID.ToString());
          *                  break;
          *              }
          *          }
          *          e.Appointment.Attributes["EventTypeID"] = e.Appointment.Attributes["EventTypeID"].ToString();
          *      }
          *      break;
          *  default:
          *      e.Cancel = true;
          *      Response.Redirect("IPAM_Workshops/IPAMWorkshops_Workshop_EventInformation.aspx?eid=" + e.Appointment.ID.ToString());
          *      break;
          * }*/
     }
     else
     {
         /*e.Appointment.Attributes["EventTypeID"] = "999";*/
     }
 }
        protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
        {
            if (string.IsNullOrEmpty(e.Appointment.Attributes["LastModified"]))
            {
                e.Appointment.Attributes["LastModified"] = "Never";
                //affDS.SelectParameters[0].DefaultValue = Session["RepAreaIDFromAdmin"].ToString();

                if (e.Appointment.Resources.GetResourceByType("Affiliation") == null && e.Appointment.ID != null)
                {
                    con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["AmounCrmConnectionString"].ToString());
                    string s = "Select Distinct AffiliationID, AreaRecID From Appointments WHERE AppointmentID = " + int.Parse(e.Appointment.ID.ToString());
                    cmd = new SqlCommand(s, con);
                    con.Open();
                    SqlDataReader dr = cmd.ExecuteReader();
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            repAreaID = int.Parse(dr["AreaRecID"].ToString());
                            Session["RepAreaIDFromAdmin"]          = repAreaID;
                            Session["ParticipantIDFromAdmin"]      = dr["AffiliationID"].ToString();
                            affDS.SelectParameters[0].DefaultValue = Session["RepAreaIDFromAdmin"].ToString();//Session["RepAreaIDFromAdmin"] instead of repAreaID
                        }
                    }
                    dr.Close();
                }
                else
                {
                    //Session["ParticipantIDFromAdmin"] = e.Appointment.Resources.GetResourceByType("Affiliation").Key.ToString();
                    affDS.SelectParameters[0].DefaultValue = Session["RepAreaIDFromAdmin"].ToString();//Session["RepAreaIDFromAdmin"] instead of repAreaID
                }
            }
        }
예제 #3
0
    protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
    {
        //if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.Edit)
        //{
        //    EditedAppointmentID = e.Appointment.ID;
        //    e.Cancel = true;

        //    ScriptManager.RegisterStartupScript(Page, GetType(), "formScript", "Sys.Application.add_load(openForm);", true);
        //    PopulateEditForm(e.Appointment);
        //}
    }
        protected void ScheduleList_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
        {
            var selectedProjectDetailId = Convert.ToInt64(SelectedProjectDetailId.Value);
            var selectedProjectDetail   = ProjectScheduleProjectDetailList.SingleOrDefault(p => p.ProjectDetailId == selectedProjectDetailId);

            if (selectedProjectDetail != null)
            {
                if (e.Appointment.Start < selectedProjectDetail.StartDate || e.Appointment.Start > selectedProjectDetail.EndDate)
                {
                    e.Cancel = true;
                }
            }
        }
예제 #5
0
 protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
 {
     if (e.Mode == SchedulerFormMode.AdvancedEdit || e.Mode == SchedulerFormMode.AdvancedInsert)
     {
         IList <Resource> remainingResources = Session["remainingResources"] as List <Resource>;
         if (remainingResources != null)
         {
             foreach (Resource resource in remainingResources)
             {
                 RadScheduler1.Resources.Add(resource);
             }
             Session.Remove("remainingResources");
         }
     }
 }
예제 #6
0
 protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
 {
     if (e.Mode == SchedulerFormMode.AdvancedEdit || e.Mode == SchedulerFormMode.AdvancedInsert)
     {
         IList<Resource> remainingResources = Session["remainingResources"] as List<Resource>;
         if (remainingResources != null)
         {
             foreach (Resource resource in remainingResources)
             {
                 RadScheduler1.Resources.Add(resource);
             }
             remainingResources.Clear();
             Session["remainingResources"] = remainingResources;
         }
     }
 }
예제 #7
0
        protected void ExamScheduler_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
        {
            lblMsg.Text = string.Empty;
            if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.Edit || e.Mode == SchedulerFormMode.AdvancedEdit || e.Mode == SchedulerFormMode.AdvancedInsert)
            {
                EditedAppointment = e.Appointment;
                e.Cancel          = true;
            }
            if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.AdvancedInsert)
            {
                drpCourse.SelectedValue = "-1";
                drpExam.SelectedValue   = "-1";
                lblSubjectValue.Text    = "";
                // txtDescription.Text = string.Empty;
                lblExam.Visible             = false;
                lblCourse.Visible           = false;
                drpCourse.Visible           = true;
                drpExam.Visible             = true;
                PanelDockConfirm.Visible    = false;
                PanelDock.Visible           = true;
                btnSchedule_Reschedule.Text = "Confirm";
                RadDock1.Title = "Schedule Exam";
            }
            if (e.Mode == SchedulerFormMode.Edit || e.Mode == SchedulerFormMode.AdvancedEdit)
            {
                drpCourse.Visible           = false;
                drpExam.Visible             = false;
                lblExam.Visible             = true;
                lblCourse.Visible           = true;
                PanelDockConfirm.Visible    = false;
                PanelDock.Visible           = true;
                btnSchedule_Reschedule.Text = "Confirm";
                RadDock1.Title = "Reschedule Exam";
            }

            var appointmentToEdit = ExamScheduler.PrepareToEdit(e.Appointment, ExamScheduler.EditingRecurringSeries);

            ScriptManager.RegisterStartupScript(Page, GetType(), "formScript", "Sys.Application.add_load(openForm);", true);
            GetEditForm(appointmentToEdit);
        }
 protected void ExamScheduler_Night_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
 {
 }