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

            stockno.StockId = Convert.ToInt32(dr["StockId"]);

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

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

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

            int indexStockId = dr.GetOrdinal("StockId");
            stockno.StockId = Convert.ToInt32(dr[indexStockId]);

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

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

            return stockno;
        }