Beispiel #1
0
 protected void regメニュー名称(ConditionKey k, Object v)
 {
     regQ(k, v, getCValueメニュー名称(), "メニュー名称");
 }
Beispiel #2
0
 protected void reg終了実績日時(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue終了実績日時(), "終了実績日時");
 }
Beispiel #3
0
 protected override void setupConditionValueAndRegisterWhereClause(ConditionKey key, Object value, ConditionValue cvalue
                                                                   , String colName, ConditionOption option)
 {
     regIQ(key, value, cvalue, colName, option);
 }
 /// <summary>Get the valid values for a condition key.</summary>
 /// <param name="key">The condition keys.</param>
 public IEnumerable <string> GetValidValues(ConditionKey key)
 {
     return(this.ValidValues.TryGetValue(key, out InvariantHashSet values)
         ? values
         : null);
 }
Beispiel #5
0
 protected void reg客室コード(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue客室コード(), "客室コード");
 }
Beispiel #6
0
 protected void reg宿泊人数(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue宿泊人数(), "宿泊人数");
 }
 protected void reg職位英字名称(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue職位英字名称(), "職位英字名称");
 }
 protected void reg対象年月(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue対象年月(), "対象年月");
 }
Beispiel #9
0
 protected void reg画面コード(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue画面コード(), "画面コード");
 }
 protected void reg入社年月日(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue入社年月日(), "入社年月日");
 }
 protected void reg最終ログイン日時(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue最終ログイン日時(), "最終ログイン日時");
 }
 protected void regパスワード(ConditionKey k, Object v)
 {
     regQ(k, v, getCValueパスワード(), "パスワード");
 }
 protected void reg従業員コード(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue従業員コード(), "従業員コード");
 }
Beispiel #14
0
 protected void reg優先順位(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue優先順位(), "優先順位");
 }
Beispiel #15
0
 protected void reg客室タイプ名称(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue客室タイプ名称(), "客室タイプ名称");
 }
 protected void reg会員番号(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue会員番号(), "会員番号");
 }
Beispiel #17
0
 protected void reg料金(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue料金(), "料金");
 }
 protected void reg名字(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue名字(), "名字");
 }
 protected void reg職位コード(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue職位コード(), "職位コード");
 }
 protected void reg名前(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue名前(), "名前");
 }
 protected void reg喫煙(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue喫煙(), "喫煙");
 }
 protected void reg会社名カナ(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue会社名カナ(), "会社名カナ");
 }
Beispiel #23
0
 protected void regId(ConditionKey k, Object v)
 {
     regQ(k, v, getCValueId(), "id");
 }
 protected void reg電話番号(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue電話番号(), "電話番号");
 }
Beispiel #25
0
 protected void reg開始実績日時(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue開始実績日時(), "開始実績日時");
 }
 protected void regメールアドレス(ConditionKey k, Object v)
 {
     regQ(k, v, getCValueメールアドレス(), "メールアドレス");
 }
Beispiel #27
0
 protected void reg備考(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue備考(), "備考");
 }
 protected void reg退会年月日(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue退会年月日(), "退会年月日");
 }
Beispiel #29
0
        /****
        ** Condition parsing
        ****/
        /// <summary>Normalise and parse the given condition values.</summary>
        /// <param name="raw">The raw condition values to normalise.</param>
        /// <param name="formatVersion">The format version specified by the content pack.</param>
        /// <param name="latestFormatVersion">The latest format version.</param>
        /// <param name="conditions">The normalised conditions.</param>
        /// <param name="error">An error message indicating why normalisation failed.</param>
        public bool TryParseConditions(InvariantDictionary <string> raw, ISemanticVersion formatVersion, ISemanticVersion latestFormatVersion, out ConditionDictionary conditions, out string error)
        {
            // no conditions
            if (raw == null || !raw.Any())
            {
                conditions = this.ConditionFactory.BuildEmpty();
                error      = null;
                return(true);
            }

            // parse conditions
            conditions = this.ConditionFactory.BuildEmpty();
            foreach (KeyValuePair <string, string> pair in raw)
            {
                // parse condition key
                if (!ConditionKey.TryParse(pair.Key, out ConditionKey key))
                {
                    error      = $"'{pair.Key}' isn't a valid condition; must be one of {string.Join(", ", Enum.GetValues(typeof(ConditionType)))}";
                    conditions = null;
                    return(false);
                }

                // validate types which require an ID
                if (this.TypesRequireID.Contains(key.Type) && string.IsNullOrWhiteSpace(key.ForID))
                {
                    error      = $"{key.Type} conditions must specify a separate ID (see readme for usage)";
                    conditions = null;
                    return(false);
                }

                // check compatibility
                foreach (var versionPair in this.MinimumVersions)
                {
                    if (formatVersion.IsOlderThan(versionPair.Key) && versionPair.Value.Contains(key.Type))
                    {
                        error      = $"{key} isn't available with format version {formatVersion} (change the {nameof(ContentConfig.Format)} field to {latestFormatVersion} to use newer features)";
                        conditions = null;
                        return(false);
                    }
                }

                // parse values
                InvariantHashSet values = this.ParseCommaDelimitedField(pair.Value);
                if (!values.Any())
                {
                    error      = $"{key} can't be empty";
                    conditions = null;
                    return(false);
                }

                // restrict to allowed values
                string[] rawValidValues = this.ConditionFactory.GetValidValues(key)?.ToArray();
                if (rawValidValues?.Any() == true)
                {
                    InvariantHashSet validValues = new InvariantHashSet(rawValidValues);
                    {
                        string[] invalidValues = values.Except(validValues, StringComparer.InvariantCultureIgnoreCase).ToArray();
                        if (invalidValues.Any())
                        {
                            error      = $"invalid {key} values ({string.Join(", ", invalidValues)}); expected one of {string.Join(", ", validValues)}";
                            conditions = null;
                            return(false);
                        }
                    }
                }

                // create condition
                conditions[key] = new Condition(key, values);
            }

            // return parsed conditions
            error = null;
            return(true);
        }
 protected void reg適用終了日(ConditionKey k, Object v)
 {
     regQ(k, v, getCValue適用終了日(), "適用終了日");
 }