Пример #1
0
        public override IModel CreateModel(DataRow dr)
        {
            StockMoveApplyDetail stockmoveapplydetail = new StockMoveApplyDetail();

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

            stockmoveapplydetail.StockMoveApplyId = Convert.ToInt32(dr["StockMoveApplyId"]);

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

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

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

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

            return stockmoveapplydetail;
        }
Пример #2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            StockMoveApplyDetail stockmoveapplydetail = new StockMoveApplyDetail();

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

            int indexStockMoveApplyId = dr.GetOrdinal("StockMoveApplyId");
            stockmoveapplydetail.StockMoveApplyId = Convert.ToInt32(dr[indexStockMoveApplyId]);

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

            int indexPaperNo = dr.GetOrdinal("PaperNo");
            if (dr["PaperNo"] != DBNull.Value)
            {
                stockmoveapplydetail.PaperNo = Convert.ToString(dr[indexPaperNo]);
            }

            int indexDeliverPlaceId = dr.GetOrdinal("DeliverPlaceId");
            if (dr["DeliverPlaceId"] != DBNull.Value)
            {
                stockmoveapplydetail.DeliverPlaceId = Convert.ToInt32(dr[indexDeliverPlaceId]);
            }

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

            return stockmoveapplydetail;
        }