Пример #1
0
        public StringModel ToStringModel <BLModel, StringModel>()
        {
            Mapper.CreateMap <OpenPurchaseOrders, StringOpenPurchaseOrders>()
            .ForAllMembers(item => item.ToString().CutDownTo(50));

            var stringModel = Mapper.Map <OpenPurchaseOrders, StringOpenPurchaseOrders>(this);

            stringModel.RowTransactionType = RowTransactionType.CutDownTo(1);

            stringModel.ExtractionDate = ExtractionDate.DateTimeToString();
            stringModel.OrderDate      = OrderDate.DateToString();

            stringModel.RequestedDate = RequestedDate.DateToString();
            stringModel.ReceivedDate  = ReceivedDate.DateToString();

            stringModel.FreeText1 = FreeText1.CutDownTo(100);
            stringModel.FreeText2 = FreeText2.CutDownTo(100);
            stringModel.FreeText3 = FreeText3.CutDownTo(100);
            stringModel.FreeText4 = FreeText4.CutDownTo(100);


            Mapper.CreateMap <StringDealerPartsMaster, StringModel>();
            var stringModelRet = Mapper.Map <StringOpenPurchaseOrders, StringModel>(stringModel);


            return(stringModelRet);
        }
Пример #2
0
        public StringModel ToStringModel <BLModel, StringModel>()
        {
            Mapper.CreateMap <TransactionalDemand, StringTransactionalDemand>()
            .ForAllMembers(item => item.ToString().CutDownTo(50));

            var stringModel = Mapper.Map <TransactionalDemand, StringTransactionalDemand>(this);

            stringModel.RowTransactionType = RowTransactionType.CutDownTo(1);

            stringModel.ExtractionDate = ExtractionDate.DateTimeToString();
            stringModel.DemandDate     = DemandDate.DateToString();

            stringModel.UseForForecasting    = UseForForecasting.CutDownTo(1);
            stringModel.UseForServiceLevel   = UseForServiceLevel.CutDownTo(1);
            stringModel.UseForClassification = UseForClassification.CutDownTo(1);
            stringModel.FreeText1            = FreeText1.CutDownTo(100);

            stringModel.FreeText2 = FreeText2.CutDownTo(100);
            stringModel.FreeText3 = FreeText3.CutDownTo(100);
            stringModel.FreeText4 = FreeText4.CutDownTo(100);

            Mapper.CreateMap <StringTransactionalDemand, StringModel>();
            var stringModelRet = Mapper.Map <StringTransactionalDemand, StringModel>(stringModel);


            return(stringModelRet);
        }