Ejemplo n.º 1
0
        public static Customer GetFromSqlDataReader(SqlDataReader reader)
        {
            var customer = new Customer
            {
                Id = SQLDataHelper.GetGuid(reader, "CustomerID"),
                CustomerGroupId      = SQLDataHelper.GetInt(reader, "CustomerGroupId", 0),
                EMail                = SQLDataHelper.GetString(reader, "EMail"),
                FirstName            = SQLDataHelper.GetString(reader, "FirstName"),
                LastName             = SQLDataHelper.GetString(reader, "LastName"),
                Patronymic           = SQLDataHelper.GetString(reader, "Patronymic"),
                RegistrationDateTime = SQLDataHelper.GetDateTime(reader, "RegistrationDateTime"),
                Phone                = SQLDataHelper.GetString(reader, "Phone"),
                Password             = SQLDataHelper.GetString(reader, "Password"),
                CustomerRole         = (Role)SQLDataHelper.GetInt(reader, "CustomerRole"),
                BonusCardNumber      = SQLDataHelper.GetNullableLong(reader, "BonusCardNumber")
            };

            return(customer);
        }