Ejemplo n.º 1
0
 public ClientAclItem(string containerPermission, ClientSchemaObjectBase member)
 {
     // TODO: Complete member initialization
     this.ContainerPermission = containerPermission;
     this.MemberID            = member.ID;
     this.MemberSchemaType    = member.SchemaType;
 }
		public ClientSchemaObjectBase Echo(ClientSchemaObjectBase clientObj, bool viaSCObject)
		{
			if (viaSCObject)
				return clientObj.ToSchemaObject().ToClientSchemaObject();
			else
				return clientObj;
		}
		public static void CheckIDProvided(ClientSchemaObjectBase obj)
		{
			if (obj == null)
				throw new ArgumentNullException("obj");

			if (string.IsNullOrEmpty(obj.ID))
				throw new ArgumentException("对象的ID未提供有效值");
		}
		private static ClientSchemaObjectBase[] GetObjectByIDInner(string[] ids, string[] objectSchemaTypes, bool normalOnly)
		{
			objectSchemaTypes.NullCheck("objectSchemaTypes");

			ClientSchemaObjectBase[] result;

			bool noIDMatch = ids != null && ids.Length == 0;

			if (noIDMatch)
			{
				result = new ClientSchemaObjectBase[0];
			}
			else
			{
				ConnectiveSqlClauseCollection builder = new ConnectiveSqlClauseCollection();
				if (ids != null)
				{
					InSqlClauseBuilder idInBuilder = new InSqlClauseBuilder("ID");
					idInBuilder.AppendItem(ids);

					builder.Add(idInBuilder);
				}

				if (objectSchemaTypes != null)
				{
					InSqlClauseBuilder typeInBuilder = new InSqlClauseBuilder("SchemaType");
					typeInBuilder.AppendItem(objectSchemaTypes);
					builder.Add(typeInBuilder);
				}

				if (normalOnly)
					builder.Add((IConnectiveSqlClause)new WhereSqlClauseBuilder().AppendItem("Status", (int)SchemaObjectStatus.Normal));

				if (builder.IsEmpty == false)
					result = SchemaObjectAdapter.Instance.Load(builder, SimpleRequestSoapMessage.Current.TimePoint).ToClientSCBaseObjectArray();
				else
					result = new ClientSchemaObjectBase[0];
			}

			return result;
		}
 public void Add(string containerPermission, ClientSchemaObjectBase member)
 {
     this.Add(new ClientAclItem(containerPermission, member));
 }
		private static void EnsureID(ClientSchemaObjectBase clientObject)
		{
			if (clientObject.ID.IsNullOrEmpty())
				clientObject.ID = UuidHelper.NewUuidString();
		}
		public ClientSchemaObjectBase UpdateObjectImageProperty(ClientSchemaObjectBase obj, string propertyName, string imageID)
		{
			var image = MCS.Library.SOA.DataObjects.ImagePropertyAdapter.Instance.Load(imageID);
			if (image == null) throw new ApplicationException("图像未找到");

			return Facade.UpdateObjectImageProperty(obj.ToSchemaObject(), propertyName, image).ToClientSchemaObject();
		}
		public ClientSchemaObjectBase UpdateObjectImageProperty(ClientSchemaObjectBase obj, string propertyName, string imageID)
		{
			return (ClientSchemaObjectBase)this.Invoke("UpdateObjectImageProperty", new object[] { obj, propertyName, imageID })[0];
		}
		public ClientSchemaObjectBase Echo(ClientSchemaObjectBase clientObj, bool viaSCObject)
		{
			return this.Invoke("Echo", new object[] { clientObj, viaSCObject })[0] as ClientSchemaObjectBase;
		}