public PropertyValue(PropertyValueViewModel Model)
        {
            InitializeComponent();
            this.Model       = Model;
            this.DataContext = Model;

            foreach (PurchaseItemPropertyValue pipv in Model.lstPropertyValues)
            {
                RowDefinition rd = new RowDefinition();
                rd.Height = new GridLength(30);
                ParentGrid.RowDefinitions.Add(rd);

                TextBlock textLabel = new TextBlock();
                textLabel.Text = pipv.CatalogItemPropertyMaster.PropertyName;
                Grid.SetRow(textLabel, ParentGrid.RowDefinitions.Count - 1);
                ParentGrid.Children.Add(textLabel);

                TextBox text = new TextBox();
                text.BorderBrush = Brushes.Gray;
                text.Height      = 24;
                Grid.SetRow(text, ParentGrid.RowDefinitions.Count - 1);
                Grid.SetColumn(text, 1);
                Binding myBinding = new Binding();
                myBinding.Source = pipv;
                myBinding.Path   = new PropertyPath("Value");
                myBinding.Mode   = BindingMode.TwoWay;
                myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
                BindingOperations.SetBinding(text, TextBox.TextProperty, myBinding);
                ParentGrid.Children.Add(text);
            }
        }
        public async Task <IActionResult> GetAssetsIdsAsync([FromBody] PropertyValueViewModel propertyValueViewModel)
        {
            string message;

            if (string.IsNullOrWhiteSpace(propertyValueViewModel.Property) || string.IsNullOrWhiteSpace(propertyValueViewModel.Value))
            {
                return(new BadRequestResult());
            }
            try
            {
                var listIds = await _assetService.GetAssetsIdsByPropertyValue(propertyValueViewModel);

                return(Ok(listIds));
            }
            catch (Exception ex)
            {
                message = ex.Message;

                _logger.Error(message);

                return(StatusCode(StatusCodes.Status500InternalServerError, message));
            }
        }
Esempio n. 3
0
 public async Task <IEnumerable <int> > GetAssetsIdsByPropertyValue(PropertyValueViewModel propertyValueVM)
 {
     return(await _bus.SendQuery(_autoMapper.Map <AssetsIdsByPropertyValueQuery>(propertyValueVM)));
 }