Example #1
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            CorporationDetail corporationdetail = new CorporationDetail();

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

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

            int indexBusinessLicenseCode = dr.GetOrdinal("BusinessLicenseCode");
            if (dr["BusinessLicenseCode"] != DBNull.Value)
            {
                corporationdetail.BusinessLicenseCode = Convert.ToString(dr[indexBusinessLicenseCode]);
            }

            int indexRegisteredCapital = dr.GetOrdinal("RegisteredCapital");
            if (dr["RegisteredCapital"] != DBNull.Value)
            {
                corporationdetail.RegisteredCapital = Convert.ToDecimal(dr[indexRegisteredCapital]);
            }

            int indexCurrencyId = dr.GetOrdinal("CurrencyId");
            if (dr["CurrencyId"] != DBNull.Value)
            {
                corporationdetail.CurrencyId = Convert.ToInt32(dr[indexCurrencyId]);
            }

            int indexRegisteredDate = dr.GetOrdinal("RegisteredDate");
            if (dr["RegisteredDate"] != DBNull.Value)
            {
                corporationdetail.RegisteredDate = Convert.ToDateTime(dr[indexRegisteredDate]);
            }

            int indexCorpProperty = dr.GetOrdinal("CorpProperty");
            if (dr["CorpProperty"] != DBNull.Value)
            {
                corporationdetail.CorpProperty = Convert.ToString(dr[indexCorpProperty]);
            }

            int indexBusinessScope = dr.GetOrdinal("BusinessScope");
            if (dr["BusinessScope"] != DBNull.Value)
            {
                corporationdetail.BusinessScope = Convert.ToString(dr[indexBusinessScope]);
            }

            int indexTaxRegisteredCode = dr.GetOrdinal("TaxRegisteredCode");
            if (dr["TaxRegisteredCode"] != DBNull.Value)
            {
                corporationdetail.TaxRegisteredCode = Convert.ToString(dr[indexTaxRegisteredCode]);
            }

            int indexOrganizationCode = dr.GetOrdinal("OrganizationCode");
            if (dr["OrganizationCode"] != DBNull.Value)
            {
                corporationdetail.OrganizationCode = Convert.ToString(dr[indexOrganizationCode]);
            }

            int indexIsChildCorp = dr.GetOrdinal("IsChildCorp");
            if (dr["IsChildCorp"] != DBNull.Value)
            {
                corporationdetail.IsChildCorp = Convert.ToBoolean(dr[indexIsChildCorp]);
            }

            int indexCorpZip = dr.GetOrdinal("CorpZip");
            if (dr["CorpZip"] != DBNull.Value)
            {
                corporationdetail.CorpZip = Convert.ToString(dr[indexCorpZip]);
            }

            int indexCorpType = dr.GetOrdinal("CorpType");
            if (dr["CorpType"] != DBNull.Value)
            {
                corporationdetail.CorpType = Convert.ToInt32(dr[indexCorpType]);
            }

            int indexIsSelf = dr.GetOrdinal("IsSelf");
            if (dr["IsSelf"] != DBNull.Value)
            {
                corporationdetail.IsSelf = Convert.ToBoolean(dr[indexIsSelf]);
            }

            int indexMemo = dr.GetOrdinal("Memo");
            if (dr["Memo"] != DBNull.Value)
            {
                corporationdetail.Memo = Convert.ToString(dr[indexMemo]);
            }

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

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

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

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

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

            return corporationdetail;
        }
Example #2
0
        public override IModel CreateModel(DataRow dr)
        {
            CorporationDetail corporationdetail = new CorporationDetail();

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

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

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

            if (dr["RegisteredCapital"] != DBNull.Value)
            {
                corporationdetail.RegisteredCapital = Convert.ToDecimal(dr["RegisteredCapital"]);
            }

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

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

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

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

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

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

            if (dr["IsChildCorp"] != DBNull.Value)
            {
                corporationdetail.IsChildCorp = Convert.ToBoolean(dr["IsChildCorp"]);
            }

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

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

            if (dr["IsSelf"] != DBNull.Value)
            {
                corporationdetail.IsSelf = Convert.ToBoolean(dr["IsSelf"]);
            }

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

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

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

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

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

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

            return corporationdetail;
        }