private async void OnInsert(object sender, RoutedEventArgs e) { var list = this.RadGridView1.ItemsSource as ObservableCollection<SICIL>; if (null != list) { SICIL sicil = new SICIL() { ADI = "18", CINSIYET = 1, MEZUNBOLK = 30, PERSONELTIPK = 1, SICILKOD = 18, SICILNO = "18", SOYADI = "18" }; list.Insert(0, sicil); CommandAdapter<SICIL> cmd = new CommandAdapter<SICIL>(App.GetSICILUrl()); //int result = await cmd.Insert(sicil, "ADI", "MEZUNBOLK", "PERSONELTIPK", "SICILKOD", "SICILNO", "SOYADI"); int result = await cmd.Insert(sicil, s => s.ADI, s => s.MEZUNBOLK, s => s.PERSONELTIPK, s => s.SICILKOD, s => s.SICILNO, s => s.SOYADI); MessageBox.Show("Insert - Etkilenen Kayıt Sayısı: " + result); await this.RebindGrid(); } }
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; } }