コード例 #1
0
        /// <summary>
        /// Gets the value of one of this object's properties.
        /// </summary>
        public string GetString(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field, string defaultValue)
        {
            var o = this.GetValue(field, defaultValue);

            if (o is string)
            {
                return((string)o);
            }
            else
            {
                return(o.ToString());
            }
        }
コード例 #2
0
        /// <summary>
        /// Gets the value of one of this object's properties.
        /// </summary>
        public System.DateTime GetDateTime(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field, System.DateTime defaultValue)
        {
            var o = this.GetValue(field, defaultValue);

            if (o is string)
            {
                System.DateTime a;
                if (System.DateTime.TryParse((string)o, out a))
                {
                    return(a);
                }
                else
                {
                    throw new System.InvalidCastException();
                }
            }
            else
            {
                return((System.DateTime)o);
            }
        }
コード例 #3
0
        /// <summary>
        /// Gets the value of one of this object's properties.
        /// </summary>
        public int GetInteger(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field, int defaultValue)
        {
            var o = this.GetValue(field, defaultValue);

            if (o is string)
            {
                int a;
                if (int.TryParse((string)o, out a))
                {
                    return(a);
                }
                else
                {
                    throw new System.InvalidCastException();
                }
            }
            else
            {
                return((int)o);
            }
        }
コード例 #4
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public string GetString(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field)
 {
     return(this.GetString(field, string.Empty));
 }
コード例 #5
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public System.DateTime GetDateTime(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field)
 {
     return(this.GetDateTime(field, System.DateTime.MinValue));
 }
コード例 #6
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public double GetDouble(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field)
 {
     return(this.GetDouble(field, double.MinValue));
 }
コード例 #7
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public int GetInteger(Acme.Northwind.EFDAL.Entity.SalesbyCategory.FieldNameConstants field)
 {
     return(this.GetInteger(field, int.MinValue));
 }