Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public StringModel ToStringModel <BLModel, StringModel>()
        {
            Mapper.CreateMap <DealerPartsMaster, StringDealerPartsMaster>()
            .ForAllMembers(item => item.ToString().CutDownTo(50));

            var stringModel = Mapper.Map <DealerPartsMaster, StringDealerPartsMaster>(this);

            stringModel.ExtractionDate = ExtractionDate.DateTimeToString();
            stringModel.Description    = Description.CutDownTo(100);

            stringModel.ActivationDate = ActivationDate.DateToString();
            stringModel.UnitCost       = UnitCost.DecimalToString(2);
            stringModel.Weight         = Weight.DecimalToString(4);

            stringModel.Volume = Volume.DecimalToString(4);
            stringModel.Active = Active.CutDownTo(1);

            stringModel.PurchasePrice = PurchasePrice.DecimalToString(2);

            stringModel.InheritStock          = InheritStock.CutDownTo(1);
            stringModel.ReplacementMultiplier = ReplacementMultiplier.DecimalToString(2);

            if (Weight == 0)
            {
                stringModel.Weight = String.Empty;
            }
            //if (UnitCost == 0) stringModel.UnitCost = String.Empty;

            if (UnitCost == null)
            {
                stringModel.UnitCostCurrency = String.Empty;
            }

            if (Volume == 0)
            {
                stringModel.Volume = String.Empty;
            }

            if (BulkOrderQuantity1 == 0)
            {
                stringModel.BulkOrderQuantity1 = String.Empty;
            }

            if (BulkOrderQuantity2 == 0)
            {
                stringModel.BulkOrderQuantity2 = String.Empty;
            }

            if (MultipleOrderQty == 0)
            {
                stringModel.MultipleOrderQty = "1";                       //String.Empty;
            }
            Mapper.CreateMap <StringDealerPartsMaster, StringModel>();
            var stringModelRet = Mapper.Map <StringDealerPartsMaster, StringModel>(stringModel);


            return(stringModelRet);
        }