Пример #1
0
        private async Task <AgreementResponse> SaveStorageAgreementAgreement(PriceHedgeFormModel formModel, Customer customer)
        {
            var storageAgreement = new StorageAgreement()
            {
                //AgreementId =
                CustomerId     = customer.CustomerId,
                GrainType      = formModel.GrainType,
                HarvestYear    = formModel.HarvestYear,
                ModeOfDelivery = formModel.DeliveryMode,
                PriceArea      = formModel.PriceArea,
                ProductItemId  = formModel.ProductItemId,
                Quantity       = formModel.CommitQuantity,
                ValidFrom      = formModel.ValidFrom,
                ValidTo        = formModel.ValidTo,
            };

            return(await _agreementRepository.SaveStorageAgreementAsync(storageAgreement));
        }
Пример #2
0
        private async Task <AgreementResponse> SaveDepaAgreement(PurchasingAgreementFormModel formModel,
                                                                 CustomerBasicInfo customer)
        {
            var purchasePeriod = GenerateFromDatePeriod(formModel.AgreementPeriod);

            var storageAgreement = new StorageAgreement()
            {
                CustomerId     = customer.CustomerNo,
                GrainType      = formModel.GrainType,
                HarvestYear    = purchasePeriod.HarvestYear,
                ModeOfDelivery = formModel.DeliveryMode,
                PriceArea      = formModel.PriceArea,
                ProductItemId  = formModel.ProductItemId,
                Quantity       = formModel.CommitQuantity,
                ValidFrom      = purchasePeriod.ValidFrom,
                ValidTo        = purchasePeriod.ValidTo,
            };

            return(await _agreementRepository.SaveStorageAgreementAsync(storageAgreement));
        }