Esempio n. 1
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            AuthGroup authgroup = new AuthGroup();

            int indexAuthGroupId = dr.GetOrdinal("AuthGroupId");
            authgroup.AuthGroupId = Convert.ToInt32(dr[indexAuthGroupId]);

            int indexAuthGroupName = dr.GetOrdinal("AuthGroupName");
            if (dr["AuthGroupName"] != DBNull.Value)
            {
                authgroup.AuthGroupName = Convert.ToString(dr[indexAuthGroupName]);
            }

            int indexAssetId = dr.GetOrdinal("AssetId");
            if (dr["AssetId"] != DBNull.Value)
            {
                authgroup.AssetId = Convert.ToInt32(dr[indexAssetId]);
            }

            int indexTradeDirection = dr.GetOrdinal("TradeDirection");
            if (dr["TradeDirection"] != DBNull.Value)
            {
                authgroup.TradeDirection = Convert.ToInt32(dr[indexTradeDirection]);
            }

            int indexTradeBorder = dr.GetOrdinal("TradeBorder");
            if (dr["TradeBorder"] != DBNull.Value)
            {
                authgroup.TradeBorder = Convert.ToInt32(dr[indexTradeBorder]);
            }

            int indexContractInOut = dr.GetOrdinal("ContractInOut");
            if (dr["ContractInOut"] != DBNull.Value)
            {
                authgroup.ContractInOut = Convert.ToInt32(dr[indexContractInOut]);
            }

            int indexContractLimit = dr.GetOrdinal("ContractLimit");
            if (dr["ContractLimit"] != DBNull.Value)
            {
                authgroup.ContractLimit = Convert.ToInt32(dr[indexContractLimit]);
            }

            int indexCorpId = dr.GetOrdinal("CorpId");
            if (dr["CorpId"] != DBNull.Value)
            {
                authgroup.CorpId = Convert.ToInt32(dr[indexCorpId]);
            }

            int indexAuthGroupStatus = dr.GetOrdinal("AuthGroupStatus");
            if (dr["AuthGroupStatus"] != DBNull.Value)
            {
                authgroup.AuthGroupStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexAuthGroupStatus]);
            }

            int indexCreatorId = dr.GetOrdinal("CreatorId");
            if (dr["CreatorId"] != DBNull.Value)
            {
                authgroup.CreatorId = Convert.ToInt32(dr[indexCreatorId]);
            }

            int indexCreateTime = dr.GetOrdinal("CreateTime");
            if (dr["CreateTime"] != DBNull.Value)
            {
                authgroup.CreateTime = Convert.ToDateTime(dr[indexCreateTime]);
            }

            int indexLastModifyId = dr.GetOrdinal("LastModifyId");
            if (dr["LastModifyId"] != DBNull.Value)
            {
                authgroup.LastModifyId = Convert.ToInt32(dr[indexLastModifyId]);
            }

            int indexLastModifyTime = dr.GetOrdinal("LastModifyTime");
            if (dr["LastModifyTime"] != DBNull.Value)
            {
                authgroup.LastModifyTime = Convert.ToDateTime(dr[indexLastModifyTime]);
            }

            return authgroup;
        }
Esempio n. 2
0
        public override IModel CreateModel(DataRow dr)
        {
            AuthGroup authgroup = new AuthGroup();

            authgroup.AuthGroupId = Convert.ToInt32(dr["AuthGroupId"]);

            if (dr["AuthGroupName"] != DBNull.Value)
            {
                authgroup.AuthGroupName = Convert.ToString(dr["AuthGroupName"]);
            }

            if (dr["AssetId"] != DBNull.Value)
            {
                authgroup.AssetId = Convert.ToInt32(dr["AssetId"]);
            }

            if (dr["TradeDirection"] != DBNull.Value)
            {
                authgroup.TradeDirection = Convert.ToInt32(dr["TradeDirection"]);
            }

            if (dr["TradeBorder"] != DBNull.Value)
            {
                authgroup.TradeBorder = Convert.ToInt32(dr["TradeBorder"]);
            }

            if (dr["ContractInOut"] != DBNull.Value)
            {
                authgroup.ContractInOut = Convert.ToInt32(dr["ContractInOut"]);
            }

            if (dr["ContractLimit"] != DBNull.Value)
            {
                authgroup.ContractLimit = Convert.ToInt32(dr["ContractLimit"]);
            }

            if (dr["CorpId"] != DBNull.Value)
            {
                authgroup.CorpId = Convert.ToInt32(dr["CorpId"]);
            }

            if (dr["AuthGroupStatus"] != DBNull.Value)
            {
                authgroup.AuthGroupStatus = (Common.StatusEnum)Convert.ToInt32(dr["AuthGroupStatus"]);
            }

            if (dr["CreatorId"] != DBNull.Value)
            {
                authgroup.CreatorId = Convert.ToInt32(dr["CreatorId"]);
            }

            if (dr["CreateTime"] != DBNull.Value)
            {
                authgroup.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
            }

            if (dr["LastModifyId"] != DBNull.Value)
            {
                authgroup.LastModifyId = Convert.ToInt32(dr["LastModifyId"]);
            }

            if (dr["LastModifyTime"] != DBNull.Value)
            {
                authgroup.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            }

            return authgroup;
        }