예제 #1
0
        protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            string timestamp = e.Appointment.Attributes["LastModified"];

            if (string.IsNullOrEmpty(timestamp))
            {
                timestamp = "Never";
            }

            // Set the appointment's tooltip to show when the appointment was last modified.
            e.Appointment.ToolTip = "Last modified on: " + timestamp;

            e.Appointment.BackColor = Color.White;
            //Conditional Coloring Based On Appointment Case
            if (e.Appointment.Attributes["Annotations"] == "Appointment")
            {
                e.Appointment.ForeColor = Color.White;
                e.Appointment.BackColor = Color.Red;
            }
            if (e.Appointment.Attributes["Annotations"] == "Created")
            {
                e.Appointment.ForeColor = Color.Black;
                e.Appointment.BackColor = Color.Yellow;
            }
            if (e.Appointment.Attributes["Annotations"] == "Final Save")
            {
                e.Appointment.ForeColor = Color.White;
                e.Appointment.BackColor = Color.Green;
            }
        }
예제 #2
0
 private void OnMicroThreadStateChanged(object sender, SchedulerEventArgs e)
 {
     if (e.MicroThread == microThread)
     {
         OnPropertyChanged<MicroThreadViewModel>(n => n.State);
     }
 }
        /// <summary>
        /// Trigger this action.
        /// This method is usually invoked by an IEventScheduler and shouldn't be called manually.
        /// </summary>
        /// <param name="scheduler">The scheduler which triggered the event</param>
        public virtual void Trigger(IEventScheduler scheduler)
        {
            var args = new SchedulerEventArgs(scheduler);

            EventTriggered?.Invoke(this, args);
            _action?.Invoke();
        }
예제 #4
0
        protected void rsAppointments_AppointmentClick(object sender, SchedulerEventArgs e)
        {
            if (usertType == Admin)
            {
                con = new SqlConnection(strcon);
                int ID = Convert.ToInt32(e.Appointment.ID);
                ViewState["ID"] = ID;
                string year = Convert.ToString(System.DateTime.Now.Year);
                //string query = "select * from tbl_AnnualEvents where DATEPART(yyyy,EventDate)='" + year + "'";// where id='" + ID + "'";
                string query = "select * from tbl_AnnualEvents where id='" + ID + "'";
                da = new SqlDataAdapter(query, con);
                ds = new DataSet();
                da.Fill(ds);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lbtCustomerID.Text = Convert.ToString(ds.Tables[0].Rows[0]["ID"]);
                    txtEventName.Text  = Convert.ToString(ds.Tables[0].Rows[0]["EventName"]);
                    string   EventDate = Convert.ToString(ds.Tables[0].Rows[0]["EventDate"]);
                    DateTime dat       = Convert.ToDateTime(EventDate);
                    txtHolidayDate.Text          = dat.ToString("MM/dd/yyyy");;
                    RadWindow2.VisibleOnPageLoad = true;
                }
            }

            else
            {
                RadWindow2.VisibleOnPageLoad = false;
            }
        }
예제 #5
0
 /// <summary>
 ///     Handles the AppointmentDataBound event of the _rsReservations control.
 /// </summary>
 /// <param name = "sender">The source of the event.</param>
 /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerEventArgs" /> instance containing the event data.</param>
 protected void _rsReservations_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     if (((AppointmentObj)e.Appointment.DataItem).Busy == true)
     {
         e.Appointment.CssClass = "rsCategoryRed";
     }
 }
예제 #6
0
 private void OnMicroThreadStateChanged(object sender, SchedulerEventArgs e)
 {
     if (e.MicroThread == microThread)
     {
         OnPropertyChanged <MicroThreadViewModel>(n => n.State);
     }
 }
예제 #7
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        RadCalendarDay radCalendarDay = new RadCalendarDay(RadCalendar1);
        radCalendarDay.Date = e.Appointment.Start;
        radCalendarDay.ItemStyle.CssClass = "DayWithAppointments";
        RadCalendar1.SpecialDays.Add(radCalendarDay);
        RadCalendar2.SpecialDays.Add(radCalendarDay);

        e.Appointment.Visible = false;
        keya();
        foreach (int key in checkBoxIDs.Keys)
        {
            CheckBox chkBox = PanelBar.Items[0].Items[0].FindControl(checkBoxIDs[key]) as CheckBox;


            if (chkBox.Checked)
            {
                Resource userRes = e.Appointment.Resources.GetResource("Calendar", key.ToString());
                if (userRes != null)
                {
                    e.Appointment.Visible = true;
                }
            }
        }

    }
예제 #8
0
        protected void radcalendar_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            switch (e.Appointment.Attributes["VenueID"].ToString())
            {
            case "1000":
                e.Appointment.CssClass = "rsResourceEvent" + e.Appointment.Attributes["VenueID"].ToString();
                if (e.Appointment.Start.Date.AddDays(1).ToShortDateString() != e.Appointment.End.Date.ToShortDateString())
                {
                    if (e.Appointment.Start.ToShortTimeString() == "12:00 AM")
                    {
                        e.Appointment.End = e.Appointment.End.AddHours(23).AddMinutes(59);
                    }
                }
                break;

            case "1001":
                e.Appointment.CssClass = "rsResourceEvent" + e.Appointment.Attributes["VenueID"].ToString();
                if (e.Appointment.Start.Date.AddDays(1).ToShortDateString() != e.Appointment.End.Date.ToShortDateString())
                {
                    if (e.Appointment.Start.ToShortTimeString() == "12:00 AM")
                    {
                        e.Appointment.End = e.Appointment.End.AddHours(23).AddMinutes(59);
                    }
                }
                break;

            case "1002":
                e.Appointment.CssClass = "rsResourceEvent" + e.Appointment.Attributes["VenueID"].ToString();
                if (e.Appointment.Start.Date.AddDays(1).ToShortDateString() != e.Appointment.End.Date.ToShortDateString())
                {
                    if (e.Appointment.Start.ToShortTimeString() == "12:00 AM")
                    {
                        e.Appointment.End = e.Appointment.End.AddHours(23).AddMinutes(59);
                    }
                }
                break;

            case "1026":
                e.Appointment.CssClass = "rsResourceEvent" + e.Appointment.Attributes["VenueID"].ToString();
                if (e.Appointment.Start.Date.AddDays(1).ToShortDateString() != e.Appointment.End.Date.ToShortDateString())
                {
                    if (e.Appointment.Start.ToShortTimeString() == "12:00 AM")
                    {
                        e.Appointment.End = e.Appointment.End.AddHours(23).AddMinutes(59);
                    }
                }
                break;

            default:
                e.Appointment.CssClass = "rsResourceEvent9999";
                if (e.Appointment.Start.Date.AddDays(1).ToShortDateString() != e.Appointment.End.Date.ToShortDateString())
                {
                    if (e.Appointment.Start.ToShortTimeString() == "12:00 AM")
                    {
                        e.Appointment.End = e.Appointment.End.AddHours(23).AddMinutes(59);
                    }
                }
                break;
            }
        }
예제 #9
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        RadCalendarDay radCalendarDay = new RadCalendarDay(RadCalendar1);

        radCalendarDay.Date = e.Appointment.Start;
        radCalendarDay.ItemStyle.CssClass = "DayWithAppointments";
        RadCalendar1.SpecialDays.Add(radCalendarDay);
        RadCalendar2.SpecialDays.Add(radCalendarDay);

        e.Appointment.Visible = false;
        keya();
        foreach (int key in checkBoxIDs.Keys)
        {
            CheckBox chkBox = PanelBar.Items[0].Items[0].FindControl(checkBoxIDs[key]) as CheckBox;


            if (chkBox.Checked)
            {
                Resource userRes = e.Appointment.Resources.GetResource("Calendar", key.ToString());
                if (userRes != null)
                {
                    e.Appointment.Visible = true;
                }
            }
        }
    }
예제 #10
0
        protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            DateTime ngayhomnay = DateTime.Today;
            //string ngaybatdau = DateTime.Parse(e.Appointment.Start.ToString()).ToString("dd-MM-yyyy");
            //string ngayketthuc = DateTime.Parse(e.Appointment.End.ToString()).ToString("dd-MM-yyyy");
            //DateTime end = DateTime.Parse(ngayketthuc);

            string p1 = e.Appointment.Attributes["jobpercent"];

            if (p1 == null)
            {
                p1 = "0";
            }

            string aa = "";

            aa += e.Appointment.Subject;
            aa += " Start:" + e.Appointment.Start.ToString("dd/MM/yyyy") + " End: " + e.Appointment.End.ToString("dd/MM/yyyy");
            aa += " Complete: " + p1 + " %";
            decimal phantram;

            try
            {
                phantram = decimal.Parse(p1);
            }
            catch
            {
                phantram = 0;
            }

            e.Appointment.ForeColor = System.Drawing.Color.Blue;

            e.Appointment.ToolTip = aa;

            if (ngayhomnay > e.Appointment.End)
            {
                if (phantram == 100)
                {
                    e.Appointment.BackColor = System.Drawing.Color.Turquoise;
                }
                else
                {
                    e.Appointment.BackColor = System.Drawing.Color.Tomato;
                }
            }
            else
            {
                if (phantram == 100)
                {
                    e.Appointment.BackColor = System.Drawing.Color.Turquoise;
                }
                else
                {
                    e.Appointment.BackColor = System.Drawing.Color.Silver;
                }
            }
        }
예제 #11
0
        private void OnMicroThreadStateChanged(object sender, SchedulerEventArgs e)
        {
            if (e.MicroThreadPreviousState == MicroThreadState.None)
            {
                return;
            }

            if (frameInfo == null)
            {
                return;
            }

            double currentTime = stopwatch.Elapsed;

            int  threadId      = Thread.CurrentThread.ManagedThreadId;
            long microThreadId = e.MicroThread.Id;

            ThreadInfo threadInfo = frameInfo.ThreadItems.FirstOrDefault(ti => ti.Id == threadId);

            if (threadInfo == null)
            {
                threadInfo = new ThreadInfo {
                    Id = threadId
                };
                frameInfo.ThreadItems.Add(threadInfo);
            }

            // pending state is used to keep trace of the micro threads recently added as 'running'
            // in order to create a proper MicroThreadInfo item when then receiving a 'waiting' notification
            MicroThreadPendingState pendingState;

            if (pendingMicroThreads.TryGetValue(microThreadId, out pendingState))
            {
                threadInfo.MicroThreadItems.Add(new MicroThreadInfo
                {
                    Id         = microThreadId,
                    BeginState = pendingState.State,
                    EndState   = e.MicroThread.State,
                    BeginTime  = Math.Max(pendingState.Time, frameInfo.BeginTime),
                    EndTime    = currentTime,
                });

                pendingMicroThreads.Remove(microThreadId);
            }
            else if (e.MicroThread.IsOver == false)
            {
                pendingMicroThreads.Add(microThreadId, new MicroThreadPendingState
                {
                    ThreadId    = threadInfo.Id,
                    Time        = currentTime,
                    State       = e.MicroThread.State,
                    MicroThread = e.MicroThread,
                });
            }
        }
예제 #12
0
    //protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
    //{
    //    if (!RadCalendar1.SelectedDate.Equals(DateTime.MinValue))
    //        RadScheduler1.SelectedDate = RadCalendar1.SelectedDate;
    //}
    //protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
    //{
    //    RadCalendar1.SelectedDate = RadScheduler1.SelectedDate;
    //    RadCalendar1.FocusedDate = RadCalendar1.SelectedDate;
    //}
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        //e.Appointment.ContextMenuID=
        e.Appointment.AllowDelete = false;

        if (e.Appointment.ID.ToString().StartsWith(HROne.Lib.Attendance.DataSource.RosterTableEvent.LEAVEAPP_ID_PREFIX))
        {
            e.Appointment.AllowEdit = false;
        }
        else
        {
            e.Appointment.AllowEdit = m_IsAllowWrite;
        }

        HROne.Lib.Attendance.DataSource.RosterTableEvent rosterTableEvent = (HROne.Lib.Attendance.DataSource.RosterTableEvent)e.Appointment.DataItem;
        e.Appointment.ToolTip = rosterTableEvent.ToolTip;
        if (rosterTableEvent.Id.StartsWith(HROne.Lib.Attendance.DataSource.RosterTableEvent.PUBLICHOLIDAY_PREFIX) ||
            rosterTableEvent.Id.StartsWith(HROne.Lib.Attendance.DataSource.RosterTableEvent.STATUTORYHOLIDAY_PREFIX))
        {
            e.Appointment.AllowEdit = false;
            e.Appointment.ForeColor = System.Drawing.Color.Red;
        }

        object dbObjectItem = HROne.Lib.Attendance.DataSource.RosterTableEvent.IDToDBObject(dbConn, e.Appointment.ID);

        if (dbObjectItem is ERosterTable)
        {
            ERosterTable rosterTable = (ERosterTable)dbObjectItem;
            ERosterCode  rosterCode  = new ERosterCode();
            rosterCode.RosterCodeID = rosterTable.RosterCodeID;
            if (ERosterCode.db.select(dbConn, rosterCode))
            {
                if (!string.IsNullOrEmpty(rosterCode.RosterCodeColorCode))
                {
                    try
                    {
                        e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml(rosterCode.RosterCodeColorCode);
                        e.Appointment.ForeColor = AppUtils.ComputeTextColor(e.Appointment.BackColor);
                    }
                    catch
                    {
                    }
                }
            }
        }
        if (RadScheduler1.SelectedView == SchedulerViewType.TimelineView)
        {
            if (RadScheduler1.Appointments.Count > 10)
            {
                RadScheduler1.Height = Unit.Parse("");
            }
        }
    }
예제 #13
0
        protected void RS_Agenda_AppointmentDataBound1(object sender, SchedulerEventArgs e)
        {
            //Carga de colores en las citas que el scheduler contenga
            string lstTec = "";

            try
            {
                AgendaRequest request = new AgendaRequest();
                request.mdlUser              = Usuario;
                request.mdlagenda.vchCodigo  = e.Appointment.Resources.GetResourceByType("vchCodigo").Text;
                request.mdlagenda.intSitioID = Usuario.intSitioID;

                //request.mdlagenda.intSitioID = usuario_;
                //lstTec = RisService.getListColorModalidad(request);
                lstTec = RisService.getListColorModalidad_Sitio(request);
                lstTec = lstTec.TrimEnd();
            }
            catch (Exception ecU)
            {
                Log.EscribeLog("Existe un error en la busqueda de color de la modalidad: " + ecU.Message, 3, Usuario.vchUsuario);
            }


            Color appointmentColor = new Color();

            appointmentColor        = Color.FromName(lstTec);
            e.Appointment.BackColor = appointmentColor;


            //DataTable dt = new DataTable();
            //try
            //{
            //    string conexion = ConfigurationManager.ConnectionStrings["BD2"].ConnectionString;
            //    using (SqlConnection conn = new SqlConnection(conexion))
            //    {
            //        string query = "SELECT vchColor FROM [tbl_CAT_Modalidad] WHERE vchCodigo = '" + e.Appointment.Resources.GetResourceByType("vchCodigo").Text + "'";
            //        SqlCommand cmd = new SqlCommand(query, conn);
            //        SqlDataAdapter da = new SqlDataAdapter(cmd);
            //        da.Fill(dt);
            //    }
            //}
            //catch
            //{ }

            //Color appointmentColor = new Color();

            //foreach (DataRow campo in dt.Rows)
            //{
            //    appointmentColor = Color.FromName(campo[0].ToString());
            //    e.Appointment.BackColor = appointmentColor;
            //}
        }
예제 #14
0
        void Scheduler_AppointmentDataBound(Object sender, SchedulerEventArgs e)
        {
            if (Scheduler.SelectedView == SchedulerViewType.AgendaView)
                return;

            Resource resource = e.Appointment.Resources.GetResourceByType("Color");
            if (resource != null)
                e.Appointment.CssClass = "rsCategory" + resource.Text;
            else
            {
                e.Appointment.CssClass = null;
            }
        }
예제 #15
0
        /// <summary>
        /// Handles the OnAppointmentDataBound event of the rScheduler control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerEventArgs"/> instance containing the event data.</param>
        protected void rScheduler_OnAppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            var taskDuration = e.Appointment.DataItem as TaskDurationMap;

            if (taskDuration != null)
            {
                if (taskDuration.IsTask)
                {
                    e.Appointment.CssClass    = "disable-delete";
                    e.Appointment.BackColor   = Color.FromArgb(247, 251, 209);
                    e.Appointment.AllowEdit   = false;
                    e.Appointment.AllowDelete = false;
                }
            }
        }
예제 #16
0
 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     if (e.Appointment.Description.ToString() == "1")
     {
         e.Appointment.BackColor = System.Drawing.Color.LightGreen;
     }
     else if (e.Appointment.Description.ToString() == "3")
     {
         e.Appointment.BackColor = System.Drawing.Color.LightBlue;
     }
     else
     {
         e.Appointment.BackColor = System.Drawing.Color.Orange;
     }
 }
 protected void RadScheduler_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     if (e.Appointment.Description.ToString() == "1")
     {
         e.Appointment.BackColor = System.Drawing.Color.FromArgb(56, 192, 54);
     }
     else if (e.Appointment.Description.ToString() == "3")
     {
         e.Appointment.BackColor = System.Drawing.Color.FromArgb(233, 233, 233);
     }
     else
     {
         e.Appointment.BackColor = System.Drawing.Color.Orange;
     }
 }
예제 #18
0
        /// <summary>
        /// Handles the AppointmentDataBound event of the EventsCalendarDisplay control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerEventArgs"/> instance containing the event data.</param>
        private void EventsCalendarDisplay_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            var @event       = (Event)e.Appointment.DataItem;
            var category     = @event.Category;
            var categoryName = string.IsNullOrEmpty(category.Name) ? this.Localize("DefaultCategory", this.LocalSharedResourceFile) : category.Name;
            var color        = category.Color ?? "Default";

            e.Appointment.CssClass = string.Format(
                CultureInfo.InvariantCulture,
                "cat-{0} rsCategory{1} {2} {3} {4}",
                Engage.Utility.ConvertToSlug(categoryName),
                Engage.Utility.ConvertToSlug(color),
                @event.IsFeatured ? "featured" : string.Empty,
                @event.IsRecurring ? "recurring" : string.Empty,
                @event.IsFull ? "seats-full" : @event.Capacity.HasValue ? "seats-available" : "no-seat-limit");
        }
 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     if (e.Appointment.DataItem != null)
     {
         if ((e.Appointment.DataItem as DLL.Appointment).UserId != StoredData.User.UserId)
         {
             e.Appointment.BackColor = System.Drawing.Color.Pink;
             e.Appointment.ForeColor = System.Drawing.Color.Black;
         }
         else
         {
             e.Appointment.BackColor = System.Drawing.Color.DarkSeaGreen;
             e.Appointment.ForeColor = System.Drawing.Color.White;
         }
     }
 }
 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     string colorAttribute = e.Appointment.Attributes["AppointmentColor"];
         if (!string.IsNullOrEmpty(colorAttribute))
         {
             int colorValue;
             if (int.TryParse(colorAttribute, out colorValue))
             {
                 Color appointmentColor = Color.FromArgb(colorValue);
                 e.Appointment.BackColor = appointmentColor;
                 e.Appointment.BorderColor = Color.Black;
                 e.Appointment.BorderStyle = BorderStyle.Solid;
                 e.Appointment.BorderWidth = Unit.Pixel(1);
             }
         }
         e.Appointment.ToolTip = e.Appointment.Subject + ": " + e.Appointment.Description;
 }
예제 #21
0
        protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            Calendario calendario = (Calendario)e.Appointment.DataItem;

            if (calendario.txt1.Equals("Asignada") && calendario.txt2.Equals("Si"))
            {
                e.Appointment.BackColor = System.Drawing.Color.Green;
            }
            if (calendario.txt1.Equals("Asignada") && calendario.txt2.Equals("No"))
            {
                e.Appointment.BackColor = System.Drawing.Color.BlueViolet;
            }
            if (calendario.txt1.Equals("Cancelada"))
            {
                e.Appointment.BackColor = System.Drawing.Color.Red;
            }
        }
예제 #22
0
    protected void rsScheduler_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        DataRowView row = (DataRowView)e.Appointment.DataItem;

        if (e.Appointment.Description == "Programming")
        {
            e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml("#5599CC");
        }
        else if (e.Appointment.Description == "Training")
        {
            e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml("#CC0000");
        }
        else
        {
            e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml("#EE8A00");
        }
        e.Appointment.ForeColor = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");
    }
예제 #23
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        string colorAttribute = e.Appointment.Attributes["AppointmentColor"];

        if (!string.IsNullOrEmpty(colorAttribute))
        {
            int colorValue;
            if (int.TryParse(colorAttribute, out colorValue))
            {
                Color appointmentColor = Color.FromArgb(colorValue);
                e.Appointment.BackColor   = appointmentColor;
                e.Appointment.BorderColor = Color.Black;
                e.Appointment.BorderStyle = BorderStyle.Solid;
                e.Appointment.BorderWidth = Unit.Pixel(1);
            }
        }
        e.Appointment.ToolTip = e.Appointment.Subject + ": " + e.Appointment.Description;
    }
예제 #24
0
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        string estado = e.Appointment.Description;
        int    id     = (int)e.Appointment.ID;

        appointment = CntAriCli.GetAppointment(id, ctx);
        //Modificamos la apariencia según el estado
        switch (estado)
        {
        case "0":
            // Citado dejamos el item como está
            e.Appointment.CssClass = "rsCategoryWhite";
            break;

        case "1":
            // Programada
            e.Appointment.CssClass = "rsCategoryBlue";     //rsCategoryRed
            break;

        case "2":
            // Sala de espera
            e.Appointment.CssClass = "rsCategoryPink";     //rsCategoryGreen
            break;

        case "3":
            // Atendido
            e.Appointment.CssClass = "rsCategoryGreen";     //rsCategoryYellow
            break;

        case "4":
            e.Appointment.CssClass = "rsCategoryYellow";
            break;

        case "5":
            // No presentado / Sin hora?
            e.Appointment.CssClass = "rsCategoryOrange";     //rsCategoryBlue
            break;

        default:
            break;
        }
        // now we charge the new description
        e.Appointment.Description = CntAriCli.GetAppointmentDescription(appointment, ctx);
    }
예제 #25
0
        public void VaaScheduler_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            try
            {
                var schedule = _scheduleManagement.GetScheduleById(Convert.ToInt16(e.Appointment.ID));

                if (schedule != null)
                {
                    var userIds = schedule.UserID;

                    if (userIds != null)
                    {
                        var usersArray = userIds.Split(new char[] { ',' });

                        for (int i = 0; i < usersArray.Length; i++)
                        {
                            if (i < ((RadScheduler)sender).Resources.GetResourcesByType("User").Count)
                            {
                                for (int j = 0; j < ((RadScheduler)sender).Resources.GetResourcesByType("User").Count; j++)
                                {
                                    if (((RadScheduler)sender).Resources.GetResourcesByType("User")[j].Key.ToString().Trim() == usersArray[i].Trim())
                                    {
                                        //add the array
                                        e.Appointment.Resources.Add(((RadScheduler)sender).Resources.GetResourcesByType("User")[j]);
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                if (e.Appointment.Attributes["Completed"] == "True")
                {
                    e.Appointment.BackColor = System.Drawing.Color.Aquamarine;
                }
            }
            catch (Exception ex)
            {
                //write to Elma
                ErrorSignal.FromCurrentContext().Raise(ex);
            }
        }
예제 #26
0
        /// <summary>
        /// Handles the OnAppointmentDataBound event of the rScheduler control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerEventArgs"/> instance containing the event data.</param>
        protected void rScheduler_OnAppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            var taskDuration = e.Appointment.DataItem as TaskDurationMap;

            if (taskDuration != null)
            {
                if (taskDuration.ResponsibleID == Task.CreatorID)
                {
                    e.Appointment.CssClass    = "disable-delete";
                    e.Appointment.BackColor   = Color.White;
                    e.Appointment.AllowEdit   = false;
                    e.Appointment.AllowDelete = false;
                }
                else if (taskDuration.ResponsibleID != CurrentUser.Instance.ContactID)
                {
                    e.Appointment.CssClass    = "disable-delete";
                    e.Appointment.BackColor   = Color.ForestGreen;
                    e.Appointment.AllowEdit   = false;
                    e.Appointment.AllowDelete = false;
                }
            }
        }
예제 #27
0
        // TODO: rename this
        public void RunPlaylist(SchedulerEventArgs e)
        {
            switch (e.Command)
            {
            case PlaybackCommands.Pause:
                PausePlayerRequestEvent();
                break;

            case PlaybackCommands.Stop:
                StopPlayerRequestEvent();
                break;

            case PlaybackCommands.Play:
                StopPlayerRequestEvent();
                PlaySoundtrack(e.PlaylistGUID, e.TrackIndex, e.Mode);
                break;

            default:
                // Add a handling process for this exception
                throw new Exception("Invalid command");
            }
        }
예제 #28
0
        /// <summary>
        /// Handles the OnAppointmentDataBound event of the rScheduler control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerEventArgs"/> instance containing the event data.</param>
        protected void rScheduler_OnAppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            var taskTypeCategoryType = int.Parse((((DataRowView)e.Appointment.DataItem)).Row["tbl_TaskType_TaskTypeCategoryID"].ToString());

            if (taskTypeCategoryType == (int)TaskTypeCategory.LongTermTask || taskTypeCategoryType == (int)TaskTypeCategory.TODO)
            {
                if (ucTaskFilter.StartDate.HasValue && ucTaskFilter.EndDate.HasValue && rScheduler.SelectedView == SchedulerViewType.DayView)
                {
                    e.Appointment.Start     = new DateTime(ucTaskFilter.StartDate.Value.Year, ucTaskFilter.StartDate.Value.Month, ucTaskFilter.StartDate.Value.Day);
                    e.Appointment.End       = new DateTime(ucTaskFilter.EndDate.Value.Year, ucTaskFilter.EndDate.Value.Month, ucTaskFilter.EndDate.Value.Day).AddHours(24);
                    e.Appointment.AllowEdit = false;
                }

                if ((taskTypeCategoryType == (int)TaskTypeCategory.TODO || taskTypeCategoryType == (int)TaskTypeCategory.LongTermTask) && rScheduler.SelectedView != SchedulerViewType.DayView)
                {
                    e.Appointment.Visible = false;
                }

                if (taskTypeCategoryType == (int)TaskTypeCategory.LongTermTask && ucTaskFilter.StartDate.HasValue && ucTaskFilter.EndDate.HasValue && rScheduler.SelectedView == SchedulerViewType.WeekView)
                {
                    e.Appointment.Start     = new DateTime(e.Appointment.Start.Year, e.Appointment.Start.Month, e.Appointment.Start.Day, 0, 0, 0);
                    e.Appointment.End       = new DateTime(e.Appointment.End.Year, e.Appointment.End.Month, e.Appointment.End.Day, 0, 0, 0).AddHours(24);
                    e.Appointment.AllowEdit = false;
                    e.Appointment.Visible   = true;
                }
            }

            if (int.Parse((((DataRowView)e.Appointment.DataItem)).Row["tbl_TaskType_TaskTypeCategoryID"].ToString()) == 0)
            {
                e.Appointment.Attributes.Add("TaskID", DataManager.TaskDuration.SelectById((Guid)e.Appointment.ID).TaskID.ToString());
            }
            else
            {
                e.Appointment.Attributes.Add("TaskID", e.Appointment.ID.ToString());
            }
        }
 /// <summary>
 /// Handles the <see cref="RadScheduler.AppointmentDataBound"/> event of the <see cref="AppointmentCalendar"/> control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerEventArgs"/> instance containing the event data.</param>
 private void AppointmentsCalendar_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     this.AppointmentToolTipManager.TargetControls.Clear();
     ScriptManager.RegisterStartupScript(this, typeof(AppointmentCalendar), "HideToolTip", "hideActiveToolTip();", true);
 }
        protected void rsAppointments_AppointmentClick(object sender, SchedulerEventArgs e)
        {
            if (usertType == Admin)
            {
                con = new SqlConnection(strcon);
                int      ID        = Convert.ToInt32(e.Appointment.ID);
                string   Even      = e.Appointment.Subject;
                string[] str       = Even.Split(' ');
                string   strResult = str[0];
                ViewState["ID"] = ID;
                string year = Convert.ToString(System.DateTime.Now.Year);

                if (strResult != "InterViewDetails")
                {
                    lblDesigna.Visible           = false;
                    lblApplicant.Visible         = false;
                    lblPhone.Visible             = false;
                    lblDesigna.Visible           = false;
                    lblAdded.Visible             = false;
                    lblAplicantfirstName.Visible = false;
                    lblPhoneNo.Visible           = false;
                    lblPhoneNo.Visible           = false;
                    lblDesignation.Visible       = false;
                    lblAddedBy.Visible           = false;
                    lbtLastName.Visible          = false;
                    Label2.Visible         = true;
                    txtEventName.Visible   = true;
                    Label2.Visible         = true;
                    txtEventName.Visible   = true;
                    Label3.Visible         = true;
                    txtHolidayDate.Visible = true;
                    btnsave.Visible        = true;
                    btnDelete.Visible      = true;

                    //string query = "select * from tbl_AnnualEvents where DATEPART(yyyy,EventDate)='" + year + "'";// where id='" + ID + "'";
                    string query = "select * from tbl_AnnualEvents where id='" + ID + "'";
                    da = new SqlDataAdapter(query, con);
                    ds = new DataSet();
                    da.Fill(ds);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        lbtCustomerID.Text = Convert.ToString(ds.Tables[0].Rows[0]["ID"]);
                        txtEventName.Text  = Convert.ToString(ds.Tables[0].Rows[0]["EventName"]);
                        string   EventDate = Convert.ToString(ds.Tables[0].Rows[0]["EventDate"]);
                        DateTime dat       = Convert.ToDateTime(EventDate);
                        txtHolidayDate.Text          = dat.ToString("MM/dd/yyyy");;
                        RadWindow2.VisibleOnPageLoad = true;
                    }
                }
                else
                {
                    lblAplicantfirstName.Visible = true;
                    lblPhoneNo.Visible           = true;
                    lblPhoneNo.Visible           = true;
                    lblDesignation.Visible       = true;
                    lblAddedBy.Visible           = true;
                    lbtLastName.Visible          = true;
                    Label2.Visible         = false;
                    txtEventName.Visible   = false;
                    Label2.Visible         = false;
                    txtEventName.Visible   = false;
                    Label3.Visible         = false;
                    txtHolidayDate.Visible = false;
                    lblDesigna.Visible     = true;
                    lblApplicant.Visible   = true;
                    lblPhone.Visible       = true;
                    lblDesigna.Visible     = true;
                    lblAdded.Visible       = true;
                    btnsave.Visible        = false;
                    btnDelete.Visible      = false;

                    int     id          = Convert.ToInt32(ViewState["ID"]);
                    DataSet ds          = AdminBLL.Instance.GetInterviewDetails(id);
                    int     applicantId = 0;
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        applicantId = Convert.ToInt32(ds.Tables[0].Rows[0]["ApplicantId"]);
                        ViewState["ApplicantId"]  = applicantId;
                        lbtCustomerID.Text        = Convert.ToString(ds.Tables[0].Rows[0]["ID"]);
                        lblAplicantfirstName.Text = Convert.ToString(ds.Tables[0].Rows[0]["FristName"]);
                        lblPhoneNo.Text           = Convert.ToString(ds.Tables[0].Rows[0]["Phone"]);
                        lblDesignation.Text       = Convert.ToString(ds.Tables[0].Rows[0]["Designation"]);
                        int    a     = Convert.ToInt32(ds.Tables[0].Rows[0]["EventAddedBy"]);
                        string query = "select * from tblUsers where id='" + a + "'";
                        da = new SqlDataAdapter(query, con);
                        DataSet dsid = new DataSet();
                        da.Fill(dsid);

                        if (dsid.Tables[0].Rows.Count > 0)
                        {
                            lblAddedBy.Text = Convert.ToString(dsid.Tables[0].Rows[0]["Username"]);
                        }
                        lbtLastName.Text = Convert.ToString(ds.Tables[0].Rows[0]["LastName"]);

                        RadWindow2.VisibleOnPageLoad = true;
                    }
                }
            }

            else
            {
                RadWindow2.VisibleOnPageLoad = false;
            }
        }
예제 #31
0
        private async void Scheduler_OnSchedule(object sender, SchedulerEventArgs e)
        {
            DateTime currentTime = Tracker.GetCurrentHourDateTime();

            if (currentTime != _lastTrackerUpdate)
            {
                _lastTrackerUpdate = currentTime;

                Tracker.CalculatedTrackingHours();
            }

            Scheduler scheduler = e.Scheduler;

            //Allowing event to be called to update tracked hours when not running
            if (!scheduler.Enabled)
            {
                return;
            }

            //Don't auto start when max level is hit
            if (UserSettings.MaxLevel != 0 && Level >= UserSettings.MaxLevel)
            {
                return;
            }

            //Should not start with these states
            if (AccountState == AccountState.PermAccountBan || AccountState == AccountState.NotVerified)
            {
                return;
            }

            int delay = 0;

            lock (_rand)
            {
                delay = _rand.Next(0, 45000);
            }

            if (e.Scheduler.WithinTime())
            {
                if (State == Enums.BotState.Stopped)
                {
                    //Only auto start when both are below min values
                    //Otherwise we'll get constant start/stops
                    if ((PokemonCaught <= scheduler.PokemonLimiter.Min || scheduler.PokemonLimiter.Option == SchedulerOption.Nothing) &&
                        (PokestopsFarmed <= scheduler.PokeStoplimiter.Min || scheduler.PokeStoplimiter.Option == SchedulerOption.Nothing))
                    {
                        LogCaller(new LoggerEventArgs(String.Format("Auto starting (schedule) in {0} seconds...", delay / 1000), LoggerTypes.Debug));

                        await Task.Delay(delay);

                        Start();
                    }
                }
            }
            else
            {
                if (State != Enums.BotState.Stopping && State != Enums.BotState.Stopped)
                {
                    LogCaller(new LoggerEventArgs("Auto stopping (schedule) ...", LoggerTypes.Debug));
                    Stop();
                }
            }

            if (!IsRunning)
            {
                return;
            }

            //Master stop
            if (scheduler.MasterOption == SchedulerOption.StartStop)
            {
                if (State != BotState.Stopping && State != BotState.Stopped)
                {
                    if (PokemonCaught >= scheduler.PokemonLimiter.Max && PokestopsFarmed >= scheduler.PokeStoplimiter.Max)
                    {
                        LogCaller(new LoggerEventArgs("Max pokemon and pokestop limit reached. Stopping", LoggerTypes.Debug));
                        Stop();

                        return;
                    }
                }
            }

            //Pokemon
            if (scheduler.PokemonLimiter.Option != SchedulerOption.Nothing)
            {
                if (PokemonCaught >= scheduler.PokemonLimiter.Max)
                {
                    switch (scheduler.PokemonLimiter.Option)
                    {
                    case SchedulerOption.DisableEnable:     //No extra checks
                        if (UserSettings.CatchPokemon)
                        {
                            LogCaller(new LoggerEventArgs("Max pokemon limit reached. Disabling setting...", LoggerTypes.Debug));
                            UserSettings.CatchPokemon = false;
                        }
                        break;

                    case SchedulerOption.StartStop:     //Just stop it
                        LogCaller(new LoggerEventArgs("Max pokemon limit reached. Stopping bot...", LoggerTypes.Debug));
                        Stop();
                        break;
                    }
                }
                else if (PokemonCaught <= scheduler.PokemonLimiter.Min)
                {
                    switch (scheduler.PokemonLimiter.Option)
                    {
                    case SchedulerOption.DisableEnable:     //No extra checks
                        if (!UserSettings.CatchPokemon)
                        {
                            LogCaller(new LoggerEventArgs("Min pokemon limit reached. Enabling catching...", LoggerTypes.Debug));
                            UserSettings.CatchPokemon = true;
                        }
                        break;

                    case SchedulerOption.StartStop:     //Start only if pokestop is disabled/nothing or pokestops below threshold
                        if (scheduler.PokeStoplimiter.Option != SchedulerOption.StartStop ||
                            PokestopsFarmed <= scheduler.PokeStoplimiter.Min)
                        {
                            if (State == BotState.Stopped)
                            {
                                LogCaller(new LoggerEventArgs(String.Format("Min pokemon limit reached. Starting in {0} seconds", delay / 1000), LoggerTypes.Debug));

                                await Task.Delay(delay);

                                Start();
                            }
                        }
                        break;
                    }
                }
            }

            //Pokestops
            if (scheduler.PokeStoplimiter.Option != SchedulerOption.Nothing)
            {
                if (PokestopsFarmed >= scheduler.PokeStoplimiter.Max)
                {
                    switch (scheduler.PokeStoplimiter.Option)
                    {
                    case SchedulerOption.DisableEnable:     //No extra checks
                        if (UserSettings.SearchFortBelowPercent != 0)
                        {
                            LogCaller(new LoggerEventArgs("Max pokestop limit reached. Disabling...", LoggerTypes.Debug));
                            UserSettings.SearchFortBelowPercent = 0;
                        }
                        break;

                    case SchedulerOption.StartStop:     //Just stop it
                        LogCaller(new LoggerEventArgs("Max pokestop limit reached. Stopping ...", LoggerTypes.Debug));
                        Stop();
                        break;
                    }
                }
                else if (PokestopsFarmed <= scheduler.PokeStoplimiter.Min)
                {
                    switch (scheduler.PokeStoplimiter.Option)
                    {
                    case SchedulerOption.DisableEnable:     //No extra checks
                        if (UserSettings.SearchFortBelowPercent != 1000)
                        {
                            LogCaller(new LoggerEventArgs("Min pokestop limit reached. Enabling ...", LoggerTypes.Debug));
                            UserSettings.SearchFortBelowPercent = 1000;
                        }
                        break;

                    case SchedulerOption.StartStop:     //Start only if pokemon is disabled/nothing or pokemon caught below threshold
                        if (scheduler.PokemonLimiter.Option != SchedulerOption.StartStop ||
                            PokemonCaught <= scheduler.PokemonLimiter.Min)
                        {
                            if (State == BotState.Stopped)
                            {
                                LogCaller(new LoggerEventArgs(String.Format("Min pokestop limit reached. Starting in {0} seconds", delay / 1000), LoggerTypes.Debug));

                                await Task.Delay(delay);

                                Start();
                            }
                        }
                        break;
                    }
                }
            }
        }
예제 #32
0
 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     string estado = e.Appointment.Description;
     int id = (int)e.Appointment.ID;
     appointment = CntAriCli.GetAppointment(id, ctx);
     //Modificamos la apariencia según el estado
     switch (estado)
     {
         case "0":
             // Citado dejamos el item como está
             e.Appointment.CssClass = "rsCategoryWhite";
             break;
         case "1":
             // Programada
             e.Appointment.CssClass = "rsCategoryBlue"; //rsCategoryRed
             break;
         case "2":
             // Sala de espera
             e.Appointment.CssClass = "rsCategoryPink"; //rsCategoryGreen
             break;
         case "3":
             // Atendido
             e.Appointment.CssClass = "rsCategoryGreen"; //rsCategoryYellow
             break;
         case "4":
             e.Appointment.CssClass = "rsCategoryYellow";
             break;
         case "5":
             // No presentado / Sin hora?
             e.Appointment.CssClass = "rsCategoryOrange"; //rsCategoryBlue
             break;
         default:
             break;
     }
     // now we charge the new description
     e.Appointment.Description = CntAriCli.GetAppointmentDescription(appointment, ctx); // change?
     e.Appointment.ToolTip = String.Format("CITA PROGRAMADA desde la {0:HH:mm} hasta las {1:HH:mm}", appointment.BeginDateTime, appointment.EndDateTime);
 }
예제 #33
0
 /// <summary>
 /// Set color for appointments using pre-defined css classes in Telerik library.
 /// <para>For more details check : http://www.telerik.com/help/aspnet-ajax/scheduler-appearance-setting-appointment-style.html</para>
 /// </summary>
 /// <param name="e">Argument of type Telerik.Web.UI.SchedulerEventArgs</param>
 public static void SetAppointmentAttributes(SchedulerEventArgs e)
 {
     e.Appointment.ToolTip  = string.Empty; // To avoid it's default tooltip
     e.Appointment.CssClass = e.Appointment.Attributes["BookedBy"].Equals(LoggedUserEmp) ? "rsCategoryGreen" : "rsCategoryYellow";
 }
        protected void tkrsVacations_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            // For old vacations
            if (e.Appointment.ToolTip != "")
            {
                int vacationId = Int32.Parse(e.Appointment.ID.ToString());
                int companyId = Int32.Parse(hdfCompanyId.Value);

                VacationsAddDaysInformationGateway vacationsAddDaysInformationGatewayForReview = new VacationsAddDaysInformationGateway(vacationsAddTDS);
                string paymentType = vacationsAddDaysInformationGatewayForReview.GetPaymentType(vacationId);
                bool inDataBase = vacationsAddDaysInformationGatewayForReview.GetInDatabase(vacationId);

                e.Appointment.ToolTip = paymentType;

                switch (paymentType)
                {
                    case "Unpaid Leave Full Day":
                        if (!inDataBase)
                        {
                            e.Appointment.CssClass = "rsCategorySkyBlue2";
                        }
                        else
                        {
                            e.Appointment.CssClass = "rsCategoryRed2";
                            e.Appointment.AllowDelete = false;
                            e.Appointment.AllowEdit = false;
                        }
                        break;

                    case "Unpaid Leave Half Day":
                        if (!inDataBase)
                        {
                            e.Appointment.CssClass = "rsCategorySkyBlue2";
                        }
                        else
                        {
                            e.Appointment.CssClass = "rsCategoryRed2";
                            e.Appointment.AllowDelete = false;
                            e.Appointment.AllowEdit = false;
                        }
                        break;

                    case "Full Vacation Day":
                        if (!inDataBase)
                        {
                            e.Appointment.CssClass = "rsCategoryBlue2";
                        }
                        else
                        {
                            e.Appointment.CssClass = "rsCategoryGreen2";
                            e.Appointment.AllowDelete = false;
                            e.Appointment.AllowEdit = false;
                        }
                        break;

                    case "Half Vacation Day":
                        if (!inDataBase)
                        {
                            e.Appointment.CssClass = "rsCategoryBlue2";
                        }
                        else
                        {
                            e.Appointment.CssClass = "rsCategoryGreen2";
                            e.Appointment.AllowDelete = false;
                            e.Appointment.AllowEdit = false;
                        }
                        break;

                    default:
                        e.Appointment.CssClass = "rsCategoryGray2";
                        e.Appointment.AllowDelete = false;
                        e.Appointment.AllowEdit = false;
                        break;
                }
            }
            else
            {
                // For new vacations
                switch (e.Appointment.Subject)
                {
                    case "Unpaid Leave Full Day":
                        e.Appointment.CssClass = "rsCategorySkyBlue2";
                        break;

                    case "Unpaid Leave Half Day":
                        e.Appointment.CssClass = "rsCategorySkyBlue2";
                        break;

                    case "Full Vacation Day":
                         e.Appointment.CssClass = "rsCategoryBlue2";
                         break;

                    case "Half Vacation Day":
                        e.Appointment.CssClass = "rsCategoryBlue2";
                        break;

                    default:
                        e.Appointment.CssClass = "rsCategoryGray2";
                        e.Appointment.AllowDelete = false;
                        e.Appointment.AllowEdit = false;
                        break;
                }
            }
        }
        protected void tkrsVacations_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            switch (e.Appointment.Subject)
            {
                case "Unpaid Leave Full Day":
                    e.Appointment.CssClass = "rsCategoryRed2";
                    break;

                case "Unpaid Leave Half Day":
                    e.Appointment.CssClass = "rsCategoryRed2";
                    break;

                case "Full Vacation Day":
                    e.Appointment.CssClass = "rsCategoryGreen2";
                    break;

                case "Half Vacation Day":
                    e.Appointment.CssClass = "rsCategoryGreen2";
                    break;
            }
        }
예제 #36
0
 private void Schedule_RaiseSchedulerEvent(object sender, SchedulerEventArgs e)
 {
     _view.AskForActivity(ActualTime, LastActivity);
 }
예제 #37
0
 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     e.Appointment.BackColor   = Color.GreenYellow;
     e.Appointment.BorderColor = Color.HotPink;
 }
        /// <summary>
        /// Handles the AppointmentDataBound event of the EventsCalendarDisplay control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.SchedulerEventArgs"/> instance containing the event data.</param>
        private void EventsCalendarDisplay_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            var @event = (Event)e.Appointment.DataItem;
            var category = @event.Category;
            var categoryName = string.IsNullOrEmpty(category.Name) ? this.Localize("DefaultCategory", this.LocalSharedResourceFile) : category.Name;
            var color = category.Color ?? "Default";

            e.Appointment.CssClass = string.Format(
                CultureInfo.InvariantCulture,
                "cat-{0} rsCategory{1} {2} {3} {4}",
                Engage.Utility.ConvertToSlug(categoryName),
                Engage.Utility.ConvertToSlug(color),
                @event.IsFeatured ? "featured" : string.Empty,
                @event.IsRecurring ? "recurring" : string.Empty,
                @event.IsFull ? "seats-full" : @event.Capacity.HasValue ? "seats-available" : "no-seat-limit");
        }
예제 #39
0
        public void ShowEventSetting <T>(T evnt, DisplayMode mode) where T : class, IEvent
        {
            WindowMode        = mode;
            IsReadOnly        = (mode == DisplayMode.ShowInfo) ? true : false;
            evntToBeUpdated   = (mode == DisplayMode.Edit) ? evnt as T : null;
            txtEventName.Text = evnt.EventText;
            txtRank.Text      = evnt.Rank.ToString();

            // beginning time
            if (evnt.GetType().Equals(typeof(CustomEvent)))
            {
                dateTimePicker.Value = evnt.BeginningTime;
            }
            else if (evnt.GetType().Equals(typeof(MultiTriggerEvent)))
            {
                MultiTriggerEvent mte = evnt as MultiTriggerEvent;
                dateTimePicker.Value = mte.BeginningTimeQueue.Peek();
                for (int i = 1; i < mte.BeginningTimeQueue.Count; i++)
                {
                    Button     btn;
                    TimePicker tp;
                    ChangeMarginOfTimePickerContainer(true);
                    CreateTimePickerGroup(mte.BeginningTimeQueue.ElementAt(i), out btn, out tp);
                    btn.IsEnabled = !IsReadOnly;
                    tp.IsEnabled  = !IsReadOnly;
                }
            }

            timeSpanUpDown.Value     = evnt.Duration;
            chkSetDuration.IsChecked = (evnt.Duration == TimeSpan.Zero) ? false : true;

            // Recurring frequency
            if (Enum.GetValues(typeof(RecurringFrequencies)).Contains <RecurringFrequencies>(evnt.RecurringFrequency))
            {
                cmbRecurringFreq.SelectedItem = evnt.RecurringFrequency;
            }
            else
            {
                cmbRecurringFreq.SelectedItem = RecurringFrequencies.Custom;
                ConvertRecurringFreqToBlocks(evnt.RecurringFrequency);
            }

            gridRecurringDate.IsEnabled     = IsReadOnly ? false : true;
            chkAutoDelete.IsChecked         = evnt.AutoDelete;
            chkThisDayForwardOnly.IsChecked = evnt.ThisDayForwardOnly;

            // Settings of playback
            SchedulerEventArgs actionArgs = evnt.ActionStartsEventArgs as SchedulerEventArgs;

            cmbPlaylist.SelectedItem = cmbPlaylist.Items.OfType <Playlist>().ToList().Find(x => x.GUID == actionArgs.PlaylistGUID);
            // NOTICE: mode should be set first, because it affects the item source of `cmbTrackIndex`
            cmbPlaybackMode.SelectedItem = actionArgs.Mode;
            cmbTrackIndex.SelectedItem   = actionArgs.TrackIndex;

            if (IsReadOnly)
            {
                foreach (Control ctrl in controlList)
                {
                    ctrl.IsEnabled = false;
                }
            }
        }
예제 #40
0
 protected void RadScheduler1_AppointmentClick(object sender, SchedulerEventArgs e)
 {
 }
예제 #41
0
 /// <summary>
 ///     Handles the AppointmentDataBound event of the _rsReservations control.
 /// </summary>
 /// <param name = "sender">The source of the event.</param>
 /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerEventArgs" /> instance containing the event data.</param>
 protected void _rsReservations_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
     if (((AppointmentObj) e.Appointment.DataItem).Busy == true)
     {
         e.Appointment.CssClass = "rsCategoryRed";
     }
 }
예제 #42
0
 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
 {
 }
        protected void tkrsVacations_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            int vacationId = Int32.Parse(e.Appointment.ID.ToString());
            int companyId = Int32.Parse(hdfCompanyId.Value);

            VacationsInformationDaysInformation vacationsInformationDaysInformation = new VacationsInformationDaysInformation();
            vacationsInformationDaysInformation.LoadByVacationId(vacationId, companyId);
            VacationsInformationDaysInformationGateway vacationsInformationDaysInformationGateway = new VacationsInformationDaysInformationGateway(vacationsInformationDaysInformation.Data);

            int requestId = vacationsInformationDaysInformationGateway.GetRequestID(vacationId);
            string paymentType = vacationsInformationDaysInformationGateway.GetPaymentType(vacationId);

            e.Appointment.ToolTip = paymentType;

            switch (paymentType)
            {
                case "Unpaid Leave Full Day":
                    e.Appointment.CssClass = "rsCategoryRed2";
                    break;

                case "Unpaid Leave Half Day":
                    e.Appointment.CssClass = "rsCategoryRed2";
                    break;

                case "Full Vacation Day":
                    e.Appointment.CssClass = "rsCategoryGreen2";
                    break;

                case "Half Vacation Day":
                    e.Appointment.CssClass = "rsCategoryGreen2";
                    break;
            }
        }