Пример #1
0
 public AusterityForm(ICosmosDbContext context, Austeritys austerity)
 {
     InitializeComponent();
     Austerity             = austerity;
     tbString.Text         = Austerity.String;
     tbType.Text           = Austerity.Type;
     dgvSources.DataSource = Austerity.Sources;
 }
 private void btnLoadSources_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Austeritys selected = (Austeritys)dgAusterities.SelectedItems[0];
         dgSources.ItemsSource = selected.Sources;
     }
     catch { }
 }
 private void dgAusterities_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         SelectedAusterity     = (Austeritys)dgAusterities.SelectedItems[0];
         dgSources.ItemsSource = SelectedAusterity.Sources;
     }
     catch { }
 }
 public AusterityWindow(CosmosDbContext context)
 {
     InitializeComponent();
     DataChanged = false;
     _context    = context;
     Austerity   = new Austeritys()
     {
         Id = Guid.NewGuid().ToString()
     };
 }
        public AusterityWindow(CosmosDbContext context, Austeritys austerity)
        {
            InitializeComponent();
            DataChanged = false;
            _context    = context;
            Austerity   = austerity;

            tbString.Text           = Austerity.String;
            cbType.Text             = Austerity.Type;
            ctrlSources.SourceItems = Austerity.Sources;
        }
Пример #6
0
 public async Task OnGet([FromQuery] string partition, [FromQuery] string id)
 {
     if (partition != null && id != null)
     {
         Austerity = await _context.ReadItemAsync <Austeritys>(id,
                                                               new Microsoft.Azure.Cosmos.PartitionKey(partition),
                                                               _context.AusterityContainer);
     }
     else
     {
         Austerity.Id = Guid.NewGuid().ToString();
     }
 }
Пример #7
0
 public AusterityForm(ICosmosDbContext context)
 {
     InitializeComponent();
     Austerity = new ();
 }