Ejemplo n.º 1
0
 public RestrictionCreatedOrUpdated(string externalIdentifier, List <string> salesAreas,
                                    DateTime startDate, DateTime?endDate, TimeSpan?startTime, TimeSpan?endTime, string restrictionDays,
                                    IncludeOrExcludeOrEither schoolHolidayIndicator, IncludeOrExcludeOrEither publicHolidayIndicator,
                                    IncludeOrExclude?liveProgrammeIndicator, RestrictionType?restrictionType, RestrictionBasis?restrictionBasis,
                                    string externalProgRef, string programmeCategory, string programmeClassification, IncludeOrExclude?programmeClassificationIndicator,
                                    int timeToleranceMinsBefore, int timeToleranceMinsAfter, int?indexType, int?indexThreshold,
                                    int?productCode, string clashCode, string clearanceCode, string clockNumber, int?episodeNo)
 {
     ExternalIdentifier               = externalIdentifier;
     SalesAreas                       = salesAreas;
     StartDate                        = startDate;
     EndDate                          = endDate;
     StartTime                        = startTime;
     EndTime                          = endTime;
     RestrictionDays                  = restrictionDays;
     SchoolHolidayIndicator           = schoolHolidayIndicator;
     PublicHolidayIndicator           = publicHolidayIndicator;
     LiveProgrammeIndicator           = liveProgrammeIndicator;
     RestrictionType                  = restrictionType;
     RestrictionBasis                 = restrictionBasis;
     ExternalProgRef                  = externalProgRef;
     ProgrammeCategory                = programmeCategory;
     ProgrammeClassification          = programmeClassification;
     ProgrammeClassificationIndicator = programmeClassificationIndicator;
     TimeToleranceMinsBefore          = timeToleranceMinsBefore;
     TimeToleranceMinsAfter           = timeToleranceMinsAfter;
     IndexType                        = indexType;
     IndexThreshold                   = indexThreshold;
     ProductCode                      = productCode;
     ClashCode                        = clashCode;
     ClearanceCode                    = clearanceCode;
     ClockNumber                      = string.IsNullOrWhiteSpace(clockNumber) ? "0" : clockNumber;
     EpisodeNo                        = episodeNo;
 }
Ejemplo n.º 2
0
        public static string ToAgIncludeExcludeEither(IncludeOrExcludeOrEither indexOrExcludeOrEither)
        {
            switch (indexOrExcludeOrEither)
            {
            case IncludeOrExcludeOrEither.I:
                return("Y");

            case IncludeOrExcludeOrEither.E:
                return("N");

            case IncludeOrExcludeOrEither.X:
                return("X");

            default:
                throw new ArgumentOutOfRangeException(nameof(indexOrExcludeOrEither), indexOrExcludeOrEither, null);
            }
        }
Ejemplo n.º 3
0
        protected CallMethodResult UpdateRange(Guid uid, DateTime startDate, DateTime?endDate,
                                               string restrictionDays, TimeSpan?startTime, TimeSpan?endTime,
                                               int timeToleranceMinsAfter, int timeToleranceMinsBefore,
                                               IncludeOrExcludeOrEither schoolHolidayIndicator, IncludeOrExcludeOrEither publicHolidayIndicator)
        {
            DbContext.WaitForIndexesAfterSaveChanges();

            var restriction = GetById(uid);

            restriction.StartDate               = startDate;
            restriction.EndDate                 = endDate;
            restriction.RestrictionDays         = restrictionDays;
            restriction.StartTime               = startTime;
            restriction.EndTime                 = endTime;
            restriction.TimeToleranceMinsAfter  = timeToleranceMinsAfter;
            restriction.TimeToleranceMinsBefore = timeToleranceMinsBefore;
            restriction.SchoolHolidayIndicator  = schoolHolidayIndicator;
            restriction.PublicHolidayIndicator  = publicHolidayIndicator;

            Repository.UpdateRange(new[] { restriction });
            DbContext.SaveChanges();
            return(CallMethodResult.CreateHandled());
        }