Example #1
0
        public override IModel CreateModel(DataRow dr)
        {
            PayApplyAttach payapplyattach = new PayApplyAttach();

            payapplyattach.PayApplyAttachId = Convert.ToInt32(dr["PayApplyAttachId"]);

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

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

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

            return payapplyattach;
        }
Example #2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            PayApplyAttach payapplyattach = new PayApplyAttach();

            int indexPayApplyAttachId = dr.GetOrdinal("PayApplyAttachId");
            payapplyattach.PayApplyAttachId = Convert.ToInt32(dr[indexPayApplyAttachId]);

            int indexAttachId = dr.GetOrdinal("AttachId");
            if (dr["AttachId"] != DBNull.Value)
            {
                payapplyattach.AttachId = Convert.ToInt32(dr[indexAttachId]);
            }

            int indexPayApplyId = dr.GetOrdinal("PayApplyId");
            if (dr["PayApplyId"] != DBNull.Value)
            {
                payapplyattach.PayApplyId = Convert.ToInt32(dr[indexPayApplyId]);
            }

            int indexAttachType = dr.GetOrdinal("AttachType");
            if (dr["AttachType"] != DBNull.Value)
            {
                payapplyattach.AttachType = Convert.ToInt32(dr[indexAttachType]);
            }

            return payapplyattach;
        }