Beispiel #1
0
        public override IModel CreateModel(DataRow dr)
        {
            AuthGroupDetail authgroupdetail = new AuthGroupDetail();

            authgroupdetail.DetailId = Convert.ToInt32(dr["DetailId"]);

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

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

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

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

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

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

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

            return authgroupdetail;
        }
Beispiel #2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            AuthGroupDetail authgroupdetail = new AuthGroupDetail();

            int indexDetailId = dr.GetOrdinal("DetailId");
            authgroupdetail.DetailId = Convert.ToInt32(dr[indexDetailId]);

            int indexAuthGroupId = dr.GetOrdinal("AuthGroupId");
            if (dr["AuthGroupId"] != DBNull.Value)
            {
                authgroupdetail.AuthGroupId = Convert.ToInt32(dr[indexAuthGroupId]);
            }

            int indexEmpId = dr.GetOrdinal("EmpId");
            if (dr["EmpId"] != DBNull.Value)
            {
                authgroupdetail.EmpId = Convert.ToInt32(dr[indexEmpId]);
            }

            int indexDetailStatus = dr.GetOrdinal("DetailStatus");
            if (dr["DetailStatus"] != DBNull.Value)
            {
                authgroupdetail.DetailStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexDetailStatus]);
            }

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

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

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

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

            return authgroupdetail;
        }