Ejemplo n.º 1
0
        public void CreateValidOptionalParamsTests(
            ResourceId resourceId,
            Alias alias,
            Label label,
            Caption caption,
            Search search,
            Match match,
            Web web,
            Highlight highlight,
            Require require,
            DateTimeDefault dateTimeDefault)
        {
            var properties = GenerateProperties(Commons.FieldTypeAPI, label, caption, search, match, web, highlight, require, dateTimeDefault);
            var request    = GenerateRequest(Parameters.Create, GenerateCreateInfos(resourceId, properties, alias));

            ExecuteCreateTest(JsonConvert.SerializeObject(request));
        }
Ejemplo n.º 2
0
        public void UpdateValidOptionalParamsTests(
            ResourceId resourceId,
            Label label,
            Caption caption,
            Search search,
            Match match,
            Web web,
            Highlight highlight,
            Require require,
            DateTimeDefault dateTimeDefault,
            FieldKind fieldKind)
        {
            var properties = GenerateProperties(Commons.FieldTypeAPI, label, caption, search, match, web, highlight, require, dateTimeDefault);
            var fieldId    = fieldKind == FieldKind.UserDefine ? PrepareUserField.Data[resourceId].FirstOrDefault() : PrepareAppField.Data[resourceId].FirstOrDefault();
            var request    = GenerateRequest(Parameters.Update, GenerateUpdateInfos(resourceId, fieldId, properties));

            ExecuteUpdateTest(JsonConvert.SerializeObject(request), fieldId, properties);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 判断中间层对象值是否为Null
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        internal bool IsDefaultValue(object value)
        {
            if (value == null)
            {
                return(true);
            }

            switch (value.GetType().FullName)
            {
            case "System.Int16":
                if (Int16Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Int32":
                if (IntDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Int64":
                if (Int64Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.UInt16":
                if (UInt16Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.UInt32":
                if (UInt32Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.UInt64":
                if (UInt64Default.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Byte":
                if (ByteDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Char":
                if (CharDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.DateTime":
                if (DateTimeDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Decimal":
                if (DecimalDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Double":
                if (DoubleDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Single":
                if (SingleDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.String":
                if (StringDefault.Equals(value))
                {
                    return(true);
                }
                break;

            case "System.Guid":
                if (GuidDefault.Equals(value))
                {
                    return(true);
                }
                break;
                //case "System.Boolean":
                //default:
                //    break;
            }
            return(false);
        }