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

            int indexStockDetailId = dr.GetOrdinal("StockDetailId");
            pledgeapplystockdetail.StockDetailId = Convert.ToInt32(dr[indexStockDetailId]);

            int indexPledgeApplyId = dr.GetOrdinal("PledgeApplyId");
            if (dr["PledgeApplyId"] != DBNull.Value)
            {
                pledgeapplystockdetail.PledgeApplyId = Convert.ToInt32(dr[indexPledgeApplyId]);
            }

            int indexContractNo = dr.GetOrdinal("ContractNo");
            if (dr["ContractNo"] != DBNull.Value)
            {
                pledgeapplystockdetail.ContractNo = Convert.ToString(dr[indexContractNo]);
            }

            int indexNetAmount = dr.GetOrdinal("NetAmount");
            if (dr["NetAmount"] != DBNull.Value)
            {
                pledgeapplystockdetail.NetAmount = Convert.ToDecimal(dr[indexNetAmount]);
            }

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

            int indexRefNo = dr.GetOrdinal("RefNo");
            if (dr["RefNo"] != DBNull.Value)
            {
                pledgeapplystockdetail.RefNo = Convert.ToString(dr[indexRefNo]);
            }

            int indexDeadline = dr.GetOrdinal("Deadline");
            if (dr["Deadline"] != DBNull.Value)
            {
                pledgeapplystockdetail.Deadline = Convert.ToString(dr[indexDeadline]);
            }

            int indexHands = dr.GetOrdinal("Hands");
            if (dr["Hands"] != DBNull.Value)
            {
                pledgeapplystockdetail.Hands = Convert.ToInt32(dr[indexHands]);
            }

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

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

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

            pledgeapplystockdetail.StockDetailId = Convert.ToInt32(dr["StockDetailId"]);

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

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

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

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

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

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

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

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

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

            return pledgeapplystockdetail;
        }