Ejemplo n.º 1
0
        public virtual ApiSpecialOfferResponseModel MapBOToModel(
            BOSpecialOffer boSpecialOffer)
        {
            var model = new ApiSpecialOfferResponseModel();

            model.SetProperties(boSpecialOffer.SpecialOfferID, boSpecialOffer.Category, boSpecialOffer.Description, boSpecialOffer.DiscountPct, boSpecialOffer.EndDate, boSpecialOffer.MaxQty, boSpecialOffer.MinQty, boSpecialOffer.ModifiedDate, boSpecialOffer.Rowguid, boSpecialOffer.StartDate, boSpecialOffer.Type);

            return(model);
        }
        public virtual BOSpecialOffer MapEFToBO(
            SpecialOffer ef)
        {
            var bo = new BOSpecialOffer();

            bo.SetProperties(
                ef.SpecialOfferID,
                ef.Category,
                ef.Description,
                ef.DiscountPct,
                ef.EndDate,
                ef.MaxQty,
                ef.MinQty,
                ef.ModifiedDate,
                ef.Rowguid,
                ef.StartDate,
                ef.Type);
            return(bo);
        }
        public virtual SpecialOffer MapBOToEF(
            BOSpecialOffer bo)
        {
            SpecialOffer efSpecialOffer = new SpecialOffer();

            efSpecialOffer.SetProperties(
                bo.Category,
                bo.Description,
                bo.DiscountPct,
                bo.EndDate,
                bo.MaxQty,
                bo.MinQty,
                bo.ModifiedDate,
                bo.Rowguid,
                bo.SpecialOfferID,
                bo.StartDate,
                bo.Type);
            return(efSpecialOffer);
        }
Ejemplo n.º 4
0
        public virtual BOSpecialOffer MapModelToBO(
            int specialOfferID,
            ApiSpecialOfferRequestModel model
            )
        {
            BOSpecialOffer boSpecialOffer = new BOSpecialOffer();

            boSpecialOffer.SetProperties(
                specialOfferID,
                model.Category,
                model.Description,
                model.DiscountPct,
                model.EndDate,
                model.MaxQty,
                model.MinQty,
                model.ModifiedDate,
                model.Rowguid,
                model.StartDate,
                model.Type);
            return(boSpecialOffer);
        }