示例#1
0
        public override IModel CreateModel(DataRow dr)
        {
            CorpDetailAttach corpdetailattach = new CorpDetailAttach();

            corpdetailattach.CorpDetailAttachId = Convert.ToInt32(dr["CorpDetailAttachId"]);

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

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

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

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

            return corpdetailattach;
        }
示例#2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            CorpDetailAttach corpdetailattach = new CorpDetailAttach();

            int indexCorpDetailAttachId = dr.GetOrdinal("CorpDetailAttachId");
            corpdetailattach.CorpDetailAttachId = Convert.ToInt32(dr[indexCorpDetailAttachId]);

            int indexDetailId = dr.GetOrdinal("DetailId");
            if (dr["DetailId"] != DBNull.Value)
            {
                corpdetailattach.DetailId = Convert.ToInt32(dr[indexDetailId]);
            }

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

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

            int indexCorpDetailAttachStatus = dr.GetOrdinal("CorpDetailAttachStatus");
            if (dr["CorpDetailAttachStatus"] != DBNull.Value)
            {
                corpdetailattach.CorpDetailAttachStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexCorpDetailAttachStatus]);
            }

            return corpdetailattach;
        }