コード例 #1
0
        public EventDto(ActivityDto activity)
        {
            Id                = activity.Id;
            Start             = DateTime.Parse(activity.Schedule, new System.Globalization.CultureInfo("es-AR"));
            activity.Duration = activity.Duration > 0 ? activity.Duration : 60;
            End               = Start.AddMinutes(activity.Duration);
            Title             = activity.TipoActividad.Name;
            level             = activity.Level.Name;
            LevelCode         = activity.Level.Code;
            membership        = activity.MembershipType.Name;
            pendings          = activity.PendingEnrollment;
            AllowEnrollment   = false;
            BackgroundColor   = "#FF0000";
            ActivityId        = activity.Id;

            DateTime ArgentinaTime = getArgentinaTime();

            if (
                (activity.PendingEnrollment > 0) &&
                (activity.EstadoActividadId.Equals(EstadoActividad.Abierta)) &&
                ((Start - ArgentinaTime).TotalHours >= 0)
                )
            {
                AllowEnrollment = true;
                BackgroundColor = "#2196f3";
            }
            status = activity.EstadoActividad.Name;
        }
コード例 #2
0
        public EventDisponibilidadDto(ActivityDto activity)
        {
            Id    = activity.Id;
            Start = DateTime.Parse(activity.Schedule, new System.Globalization.CultureInfo("es-AR"));
            End   = Start.AddHours(1);
            Title = activity.Level.Name + " cupos: " +
                    activity.PendingEnrollment.ToString();

            level           = activity.Level.Name;
            membership      = activity.MembershipType.Name;
            pendings        = activity.PendingEnrollment;
            AllowEnrollment = false;
            BackgroundColor = "#FF0000";

            if ((activity.PendingEnrollment > 0) && (activity.EstadoActividadId.Equals(EstadoActividad.Abierta) &&
                                                     ((DateTime.Now - Start).TotalHours < 3)))
            {
                if (activity.MembershipType.Name.Equals("Menor"))
                {
                    BackgroundColor = "#2196f3";
                    if (activity.Level.Name.Equals("Inicial"))
                    {
                        Title = "INI: " + activity.PendingEnrollment.ToString();
                    }
                    else if (activity.Level.Name.Equals("Intermedio1"))
                    {
                        Title = "INT1: " + activity.PendingEnrollment.ToString();
                    }
                    else if (activity.Level.Name.Equals("Intermedio2"))
                    {
                        Title = "INT2: " + activity.PendingEnrollment.ToString();
                    }
                    else if (activity.Level.Name.Equals("Pre Equipo"))
                    {
                        Title = "PreEq: " + activity.PendingEnrollment.ToString();
                    }
                }
                else if (activity.MembershipType.Name.Equals("Adulto"))
                {
                    BackgroundColor = "#800080";
                    if (activity.Level.Name.Equals("Inicial"))
                    {
                        Title = "INI: " + activity.PendingEnrollment.ToString();
                    }
                    else if (activity.Level.Name.Equals("Intermedio"))
                    {
                        Title = "INT: " + activity.PendingEnrollment.ToString();
                    }
                    else if (activity.Level.Name.Equals("Avanzado"))
                    {
                        Title = "ADV: " + activity.PendingEnrollment.ToString();
                    }
                }
                else if (activity.MembershipType.Name.Equals("Bebe"))
                {
                    BackgroundColor = "#008000";
                    if (activity.Level.Name.Equals("Inicial"))
                    {
                        Title = "INI: " + activity.PendingEnrollment.ToString();
                    }
                }
            }
        }