Esempio n. 1
0
        public override IModel CreateModel(DataRow dr)
        {
            AuditEmp auditemp = new AuditEmp();

            auditemp.AuditEmpId = Convert.ToInt32(dr["AuditEmpId"]);

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

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

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

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

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

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

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

            return auditemp;
        }
Esempio n. 2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            AuditEmp auditemp = new AuditEmp();

            int indexAuditEmpId = dr.GetOrdinal("AuditEmpId");
            auditemp.AuditEmpId = Convert.ToInt32(dr[indexAuditEmpId]);

            int indexAuditEmpType = dr.GetOrdinal("AuditEmpType");
            if (dr["AuditEmpType"] != DBNull.Value)
            {
                auditemp.AuditEmpType = Convert.ToInt32(dr[indexAuditEmpType]);
            }

            int indexValueId = dr.GetOrdinal("ValueId");
            if (dr["ValueId"] != DBNull.Value)
            {
                auditemp.ValueId = Convert.ToInt32(dr[indexValueId]);
            }

            int indexAuditEmpStatus = dr.GetOrdinal("AuditEmpStatus");
            if (dr["AuditEmpStatus"] != DBNull.Value)
            {
                auditemp.AuditEmpStatus = (Common.StatusEnum)Convert.ToInt32(dr[indexAuditEmpStatus]);
            }

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

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

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

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

            return auditemp;
        }