private async void OnSelect(object sender, RoutedEventArgs e) { using (IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); var sicilList = await cmd.Select(); this.RadGridView1.ItemsSource = sicilList; } }
private async System.Threading.Tasks.Task RebindGrid() { using (IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); var sicilList = await cmd.Select(); this.RadGridView1.ItemsSource = new ObservableCollection<SICIL>(sicilList.OrderByDescending(s => s.SICIL2K).ToList()); } }
private async void OnSelectById(object sender, RoutedEventArgs e) { using (IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); SICIL sicil = await cmd.SelectById(9377); this.RadGridView1.ItemsSource = new List<SICIL>() { sicil }; } }
private async void OnQuery(object sender, RoutedEventArgs e) { using (IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); var sicilList = await cmd.Query("GetAll", HttpMethods.get, null); this.RadGridView1.ItemsSource = sicilList; } }
private async void OnQuerySingle(object sender, RoutedEventArgs e) { using(IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); SICIL sicil = await cmd.QuerySingle("GetById", HttpMethods.get, new Temp() { id = 9390 }); this.RadGridView1.ItemsSource = new List<SICIL>() { sicil }; } }
private async void OnBatchUpdate(object sender, RoutedEventArgs e) { using (IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { var list = this.RadGridView1.ItemsSource as IEnumerable<SICIL>; if (null != list) { CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); var result = await cmd.BatchUpdate(list, s => s.SICILKOD, s => s.ADI, s => s.SOYADI); MessageBox.Show("BatchUpdate - Etkilenen Kayıt Sayısı: " + result); } } }
private void OnLoaded(object sender, RoutedEventArgs e) { using (IndicatorManager m = new IndicatorManager(this.RadBusyIndicator1)) { //CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); // var temp = await cmd.Select(); ObservableCollection<SICIL> list = new ObservableCollection<SICIL>(); for (int j = 0; j < 5; ++j) { SICIL sicil = new SICIL(); sicil.ADI = DateTime.Now.Millisecond.ToString(); sicil.SOYADI = sicil.ADI; sicil.SICILNO = sicil.ADI; sicil.SICILKOD = DateTime.Now.Millisecond / 1000; sicil.PERSONELTIPK = 2; sicil.MEZUNBOLK = 30; list.Add(sicil); } this.RadGridView1.ItemsSource = list; } }