コード例 #1
0
        protected Array GetResultsArray(Type t, IList list, NullableInt32 entityIndex, bool distinct)
        {
            // we only need to perform an additional processing if an
            // entityIndex was specified, or if distinct was chosen.
            if (distinct || entityIndex.HasValue)
            {
                Set s = (distinct ? new ListSet() : null);

                IList newList = new ArrayList(list.Count);
                foreach (object o in list)
                {
                    object el = (!entityIndex.HasValue ? o : ((object[])o)[entityIndex.Value]);
                    if (s == null || s.Add(el))
                    {
                        newList.Add(el);
                    }
                }

                list = newList;
            }

            Array a = Array.CreateInstance(t, list.Count);

            list.CopyTo(a, 0);
            return(a);
        }
コード例 #2
0
 public Staff()
 {
     _login_id                 = String.Empty;
     _password                 = String.Empty;
     _code                     = String.Empty;
     _name                     = String.Empty;
     _sex                      = null;
     _married                  = null;
     _id_card                  = String.Empty;
     _country_tag              = String.Empty;
     _nation_tag               = String.Empty;
     _position_tag             = String.Empty;
     _title_tag                = String.Empty;
     _political_appearance_tag = String.Empty;
     _degree_tag               = String.Empty;
     _birthday                 = null;
     _enters_day               = null;
     _leaves_day               = null;
     _office_phone             = String.Empty;
     _ext_number               = String.Empty;
     _family_phone             = String.Empty;
     _cell_phone               = String.Empty;
     _email                    = String.Empty;
     _address                  = String.Empty;
     _zip_code                 = String.Empty;
     _remark                   = String.Empty;
     _is_inner_user            = 0;
     _disabled                 = 0;
     _order_id                 = 0;
     _department               = null;
     _roles                    = new HashedSet();
     _module_rights_grant      = new HashedSet();
     _module_rights_deny       = new HashedSet();
 }
コード例 #3
0
 public void SetInt32Value(string columnName, int?value)
 {
     NullableInt32 tempvalue = value.HasValue ? new NullableInt32(value.Value) : null;
     {
         CommonPINVOKE.DataRow_SetInt32Value__SWIG_1(swigCPtr, columnName, NullableInt32.getCPtr(tempvalue));
         if (CommonPINVOKE.SWIGPendingException.Pending)
         {
             throw CommonPINVOKE.SWIGPendingException.Retrieve();
         }
     }
 }
コード例 #4
0
 public static bool Equals(NullableInt32 x, NullableInt32 y)
 {
     if (x.HasValue != y.HasValue)
     {
         return(false);
     }
     if (x.HasValue)
     {
         return(x.Value == y.Value);
     }
     return(true);
 }
コード例 #5
0
 public int?ValueAsInt32(string columnName)
 {
     global::System.IntPtr cPtr = CommonPINVOKE.DataRow_ValueAsInt32__SWIG_1(swigCPtr, columnName);
     if (CommonPINVOKE.SWIGPendingException.Pending)
     {
         throw CommonPINVOKE.SWIGPendingException.Retrieve();
     }
     using (NullableInt32 tempValue = (cPtr == global::System.IntPtr.Zero) ? null : new NullableInt32(cPtr, false)) {
         if (tempValue?.HasValue() ?? false)
         {
             return(tempValue.GetValueOrDefault());
         }
         return(null);
     }
 }
コード例 #6
0
 public User()
 {
     _login_id     = String.Empty;
     _password     = String.Empty;
     _name         = String.Empty;
     _sex          = null;
     _birthday     = null;
     _id_card      = String.Empty;
     _office_phone = String.Empty;
     _family_phone = String.Empty;
     _cell_phone   = String.Empty;
     _email        = String.Empty;
     _address      = String.Empty;
     _zip_code     = String.Empty;
     _remark       = String.Empty;
     _disabled     = 0;
 }
コード例 #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Boolean.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableBoolean.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableByte.GetHashCode();
         hashCode = (hashCode * 397) ^ SByte.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableSByte.GetHashCode();
         hashCode = (hashCode * 397) ^ Char.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableChar.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDecimal.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDouble.GetHashCode();
         hashCode = (hashCode * 397) ^ Single.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableSingle.GetHashCode();
         hashCode = (hashCode * 397) ^ Int32;
         hashCode = (hashCode * 397) ^ NullableInt32.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)UInt32;
         hashCode = (hashCode * 397) ^ NullableUInt32.GetHashCode();
         hashCode = (hashCode * 397) ^ Int64.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableInt64.GetHashCode();
         hashCode = (hashCode * 397) ^ UInt64.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableUInt64.GetHashCode();
         hashCode = (hashCode * 397) ^ Int16.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableInt16.GetHashCode();
         hashCode = (hashCode * 397) ^ UInt16.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableUInt16.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Enum;
         hashCode = (hashCode * 397) ^ NullableEnum.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Nested != null ? Nested.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #8
0
ファイル: NullableInt32.cs プロジェクト: sttp/net-cppapi
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(NullableInt32 obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
コード例 #9
0
 public static bool HasValue(this NullableInt32 source)
 {
     return(source != null);
 }
コード例 #10
0
 public bool Equals(NullableInt32 x)
 {
     return(Equals(this, x));
 }