Exemplo n.º 1
0
        public virtual ApiSalesTerritoryResponseModel MapBOToModel(
            BOSalesTerritory boSalesTerritory)
        {
            var model = new ApiSalesTerritoryResponseModel();

            model.SetProperties(boSalesTerritory.TerritoryID, boSalesTerritory.CostLastYear, boSalesTerritory.CostYTD, boSalesTerritory.CountryRegionCode, boSalesTerritory.@Group, boSalesTerritory.ModifiedDate, boSalesTerritory.Name, boSalesTerritory.Rowguid, boSalesTerritory.SalesLastYear, boSalesTerritory.SalesYTD);

            return(model);
        }
        public virtual BOSalesTerritory MapEFToBO(
            SalesTerritory ef)
        {
            var bo = new BOSalesTerritory();

            bo.SetProperties(
                ef.TerritoryID,
                ef.CostLastYear,
                ef.CostYTD,
                ef.CountryRegionCode,
                ef.@Group,
                ef.ModifiedDate,
                ef.Name,
                ef.Rowguid,
                ef.SalesLastYear,
                ef.SalesYTD);
            return(bo);
        }
        public virtual SalesTerritory MapBOToEF(
            BOSalesTerritory bo)
        {
            SalesTerritory efSalesTerritory = new SalesTerritory();

            efSalesTerritory.SetProperties(
                bo.CostLastYear,
                bo.CostYTD,
                bo.CountryRegionCode,
                bo.@Group,
                bo.ModifiedDate,
                bo.Name,
                bo.Rowguid,
                bo.SalesLastYear,
                bo.SalesYTD,
                bo.TerritoryID);
            return(efSalesTerritory);
        }
Exemplo n.º 4
0
        public virtual BOSalesTerritory MapModelToBO(
            int territoryID,
            ApiSalesTerritoryRequestModel model
            )
        {
            BOSalesTerritory boSalesTerritory = new BOSalesTerritory();

            boSalesTerritory.SetProperties(
                territoryID,
                model.CostLastYear,
                model.CostYTD,
                model.CountryRegionCode,
                model.@Group,
                model.ModifiedDate,
                model.Name,
                model.Rowguid,
                model.SalesLastYear,
                model.SalesYTD);
            return(boSalesTerritory);
        }