Example #1
0
 protected override void SetControlsToDto(DistributorTransfer distributorTransfer)
 {
     distributorTransfer.Date            = _dateTimePicker.Value;
     distributorTransfer.Amount          = _amountNumericUpDown.Value;
     distributorTransfer.RublesPerDollar = _rublesPerDollarNumericUpDown.Value;
     distributorTransfer.Active          = _activeCheckBox.Checked;
 }
Example #2
0
 protected override void SetDtoToControls(DistributorTransfer distributorTransfer)
 {
     _dateTimePicker.Value               = distributorTransfer.Date;
     _amountNumericUpDown.Value          = distributorTransfer.Amount;
     _rublesPerDollarNumericUpDown.Value = distributorTransfer.RublesPerDollar;
     _activeCheckBox.Checked             = distributorTransfer.Active;
 }
Example #3
0
        public string UpdateDistributorTransfer(DistributorTransfer distributorTransfer)
        {
            CheckHelper.ArgumentNotNull(distributorTransfer, "distributorTransfer");
            CheckHelper.WithinCondition(SecurityService.IsLoggedIn, "SecurityService.IsLoggedIn");

            var errors = IoC.Container.Get <IValidateService>().Validate(distributorTransfer);

            if (errors != null)
            {
                return(errors.ToErrorMessage());
            }

            return(APIClientHelper <DocumentAPIClient> .Call(c => c.UpdateDistributorTransfer(distributorTransfer)));
        }
        protected override object[] GetDtoValues(DistributorTransfer distributorTransfer)
        {
            var values =
                new object[]
            {
                distributorTransfer.Date.ToString("d"),
                distributorTransfer.Amount,
                distributorTransfer.RublesPerDollar,
                distributorTransfer.Active.ToYesNo()
            };

            return
                (values
                 .Concat(TrackableDtoListFormHelper.GetValues(distributorTransfer))
                 .ToArray());
        }
Example #5
0
        public string CreateDistributorTransfer(DistributorTransfer distributorTransfer)
        {
            CheckHelper.ArgumentNotNull(distributorTransfer, "distributorTransfer");
            CheckHelper.WithinCondition(SecurityService.IsLoggedIn, "SecurityService.IsLoggedIn");

            var errors = IoC.Container.Get <IValidateService>().Validate(distributorTransfer);

            if (errors != null)
            {
                return(errors.ToErrorMessage());
            }

            var createdDistributorTransfer = (DistributorTransfer)distributorTransfer.Clone();

            var errorMessage = APIClientHelper <DocumentAPIClient> .Call(c => c.CreateDistributorTransfer(ref createdDistributorTransfer));

            distributorTransfer.Id = createdDistributorTransfer.Id;

            return(errorMessage);
        }
 public DistributorTransferListForm(ListFormMode mode, DistributorTransfer distributorTransfer)
     : base(mode, distributorTransfer)
 {
     InitializeComponent();
 }
Example #7
0
        public string CreateDistributorTransfer(ref DistributorTransfer distributorTransfer)
        {
            Container.Get <IDistributorTransferService>().CreateDistributorTransfer(distributorTransfer);

            return(null);
        }
Example #8
0
        public string UpdateDistributorTransfer(DistributorTransfer distributorTransfer)
        {
            Container.Get <IDistributorTransferService>().UpdateDistributorTransfer(distributorTransfer);

            return(null);
        }
Example #9
0
 protected override string OnUpdate(DistributorTransfer distributorTransfer)
 {
     return(IoCContainer.Get <IDocumentService>().UpdateDistributorTransfer(distributorTransfer));
 }