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

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

            int indexCustomsApplyId = dr.GetOrdinal("CustomsApplyId");
            if (dr["CustomsApplyId"] != DBNull.Value)
            {
                customsapplydetail.CustomsApplyId = Convert.ToInt32(dr[indexCustomsApplyId]);
            }

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

            int indexGrossWeight = dr.GetOrdinal("GrossWeight");
            if (dr["GrossWeight"] != DBNull.Value)
            {
                customsapplydetail.GrossWeight = Convert.ToDecimal(dr[indexGrossWeight]);
            }

            int indexNetWeight = dr.GetOrdinal("NetWeight");
            if (dr["NetWeight"] != DBNull.Value)
            {
                customsapplydetail.NetWeight = Convert.ToDecimal(dr[indexNetWeight]);
            }

            int indexCustomsPrice = dr.GetOrdinal("CustomsPrice");
            if (dr["CustomsPrice"] != DBNull.Value)
            {
                customsapplydetail.CustomsPrice = Convert.ToDecimal(dr[indexCustomsPrice]);
            }

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

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

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

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

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

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

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

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

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

            return customsapplydetail;
        }