コード例 #1
0
        /// <summary>
        /// 判断两个对象是否一致。主要是比较ID。如果都是null,也返回true
        /// </summary>
        /// <param name="src"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public static bool AreSame(this WfClientOguObjectBase src, WfClientOguObjectBase target)
        {
            bool result = false;

            if (src == null && target == null)
                result = true;
            else
                if (src != null && target != null)
                    result = string.Compare(src.ID, target.ID, true) == 0;

            return result;
        }
コード例 #2
0
        /// <summary>
        /// 判断两个对象是否一致。主要是比较ID。如果都是null,也返回true
        /// </summary>
        /// <param name="src"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public static bool AreSame(this WfClientOguObjectBase src, WfClientOguObjectBase target)
        {
            bool result = false;

            if (src == null && target == null)
            {
                result = true;
            }
            else
            if (src != null && target != null)
            {
                result = string.Compare(src.ID, target.ID, true) == 0;
            }

            return(result);
        }
コード例 #3
0
        public static WfClientOguObjectBase CreateWrapperObject(string id, string name, ClientOguSchemaType schemaType)
        {
            WfClientOguObjectBase result = null;

            switch (schemaType)
            {
            case ClientOguSchemaType.Organizations:
                result = new WfClientOrganization(id, name);
                break;

            case ClientOguSchemaType.Users:
                result = new WfClientUser(id, name);
                break;

            case ClientOguSchemaType.Groups:
                result = new WfClientGroup(id, name);
                break;

            default:
                throw new ApplicationException(string.Format("schemaType错误{0}", schemaType));
            }

            return(result);
        }
コード例 #4
0
 /// <summary>
 /// 判断对象是否不为空(Null或ID为空)
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool IsNotNullOrEmpty(this WfClientOguObjectBase obj)
 {
     return(IsNullOrEmpty(obj) == false);
 }
コード例 #5
0
 // <summary>
 /// 判断对象是否为空(Null或ID为空)
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool IsNullOrEmpty(this WfClientOguObjectBase obj)
 {
     return(obj == null || string.IsNullOrEmpty(obj.ID));
 }