Esempio n. 1
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            PledgeDetial pledgedetial = new PledgeDetial();

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

            int indexPledgeId = dr.GetOrdinal("PledgeId");
            if (dr["PledgeId"] != DBNull.Value)
            {
                pledgedetial.PledgeId = Convert.ToInt32(dr[indexPledgeId]);
            }

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

            int indexPledgeApplyDetailId = dr.GetOrdinal("PledgeApplyDetailId");
            if (dr["PledgeApplyDetailId"] != DBNull.Value)
            {
                pledgedetial.PledgeApplyDetailId = Convert.ToInt32(dr[indexPledgeApplyDetailId]);
            }

            int indexStockId = dr.GetOrdinal("StockId");
            if (dr["StockId"] != DBNull.Value)
            {
                pledgedetial.StockId = Convert.ToInt32(dr[indexStockId]);
            }

            int indexGrossAmount = dr.GetOrdinal("GrossAmount");
            if (dr["GrossAmount"] != DBNull.Value)
            {
                pledgedetial.GrossAmount = Convert.ToDecimal(dr[indexGrossAmount]);
            }

            int indexUnit = dr.GetOrdinal("Unit");
            if (dr["Unit"] != DBNull.Value)
            {
                pledgedetial.Unit = Convert.ToInt32(dr[indexUnit]);
            }

            int indexPledgePrice = dr.GetOrdinal("PledgePrice");
            if (dr["PledgePrice"] != DBNull.Value)
            {
                pledgedetial.PledgePrice = Convert.ToDecimal(dr[indexPledgePrice]);
            }

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

            int indexStockLogId = dr.GetOrdinal("StockLogId");
            if (dr["StockLogId"] != DBNull.Value)
            {
                pledgedetial.StockLogId = Convert.ToInt32(dr[indexStockLogId]);
            }

            return pledgedetial;
        }
Esempio n. 2
0
        public override IModel CreateModel(DataRow dr)
        {
            PledgeDetial pledgedetial = new PledgeDetial();

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

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

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

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

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

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

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

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

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

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

            return pledgedetial;
        }