Exemplo n.º 1
0
        protected void DoPost(object sender, EventArgs e)
        {
            Util.EnsureOperationSafe();

            if (this.EditEnabled)
            {
                string json = hfPostData.Value;
                var    obj  = MCS.Web.Library.Script.JSONSerializerExecute.Deserialize <SchemaPropertyDefineCollection>(json);
                var    ext  = new AU.SchemaPropertyExtension("AdminUnits", schema.ID, txtDescription.Value);
                ext.Properties.CopyFrom(obj);
                AU.Adapters.SchemaPropertyExtensionAdapter.Instance.Update(ext);
                WebUtility.ResponseCloseWindowScriptBlock();
            }
            else
            {
                WebUtility.ResponseShowClientErrorScriptBlock("没有操作权限", "此操作只能由管理员操作", "操作权限不足");
            }
        }
		protected void TestClick(object sender, EventArgs e)
		{
			string auSchemaID = Request.QueryString["auSchemaID"];
			var ext = new AU.SchemaPropertyExtension("AdminUnits", auSchemaID, "Demo");
			var ppt = new MCS.Library.SOA.DataObjects.Schemas.SchemaProperties.SchemaPropertyDefine()
			{
				Name = "Test",
				DataType = MCS.Library.SOA.DataObjects.PropertyDataType.String,
				DefaultValue = "222",
				MaxLength = 12,
				Category = "ABC",
				Description = "描述",
				DisplayName = "测试属性",
				IsRequired = true,
				ShowTitle = true,
				Visible = true,
				Tab = "Basic",
				ReadOnly = false,
			};

			ppt.Validators.Add(new MCS.Library.SOA.DataObjects.PropertyValidatorDescriptor()
			{
				MessageTemplate = "属性值有误",
				Name = "DefaultValidator",
				Tag = "bb",
				TypeDescription = "aaa"
			});

			ppt.Validators[0].Parameters.Add(new MCS.Library.SOA.DataObjects.PropertyValidatorParameterDescriptor()
			{
				DataType = MCS.Library.SOA.DataObjects.PropertyDataType.String,
				ParamName = "abc",
				ParamValue = "haha"
			});

			ext.Properties.Add(ppt);

			AU.Adapters.SchemaPropertyExtensionAdapter.Instance.Update(ext);
		}
Exemplo n.º 3
0
        protected void TestClick(object sender, EventArgs e)
        {
            string auSchemaID = Request.QueryString["auSchemaID"];
            var    ext        = new AU.SchemaPropertyExtension("AdminUnits", auSchemaID, "Demo");
            var    ppt        = new MCS.Library.SOA.DataObjects.Schemas.SchemaProperties.SchemaPropertyDefine()
            {
                Name         = "Test",
                DataType     = MCS.Library.SOA.DataObjects.PropertyDataType.String,
                DefaultValue = "222",
                MaxLength    = 12,
                Category     = "ABC",
                Description  = "描述",
                DisplayName  = "测试属性",
                IsRequired   = true,
                ShowTitle    = true,
                Visible      = true,
                Tab          = "Basic",
                ReadOnly     = false,
            };

            ppt.Validators.Add(new MCS.Library.SOA.DataObjects.PropertyValidatorDescriptor()
            {
                MessageTemplate = "属性值有误",
                Name            = "DefaultValidator",
                Tag             = "bb",
                TypeDescription = "aaa"
            });

            ppt.Validators[0].Parameters.Add(new MCS.Library.SOA.DataObjects.PropertyValidatorParameterDescriptor()
            {
                DataType   = MCS.Library.SOA.DataObjects.PropertyDataType.String,
                ParamName  = "abc",
                ParamValue = "haha"
            });

            ext.Properties.Add(ppt);

            AU.Adapters.SchemaPropertyExtensionAdapter.Instance.Update(ext);
        }
		protected void DoPost(object sender, EventArgs e)
		{
			Util.EnsureOperationSafe();

			if (this.EditEnabled)
			{
				string json = hfPostData.Value;
				var obj = MCS.Web.Library.Script.JSONSerializerExecute.Deserialize<SchemaPropertyDefineCollection>(json);
				var ext = new AU.SchemaPropertyExtension("AdminUnits", schema.ID, txtDescription.Value);
				ext.Properties.CopyFrom(obj);
				AU.Adapters.SchemaPropertyExtensionAdapter.Instance.Update(ext);
				WebUtility.ResponseCloseWindowScriptBlock();
			}
			else
			{
				WebUtility.ResponseShowClientErrorScriptBlock("没有操作权限", "此操作只能由管理员操作", "操作权限不足");
			}
		}