private void btn_simpan1_Click(object sender, RoutedEventArgs e) { try { k.sql = "update kosan set nama_kosan=@1,no_telp=@2,kota=@3,alamat=@4,kode_pos=@5, deskripsi_kost=@6 where id_pemilik = 1"; k.setparam(); k.perintah.Parameters.AddWithValue("@1", txt_nama.Text); k.perintah.Parameters.AddWithValue("@2", txt_telp.Text); k.perintah.Parameters.AddWithValue("@3", txt_kota); k.perintah.Parameters.AddWithValue("@4", txt_alamat.Text); k.perintah.Parameters.AddWithValue("@5", txt_kdpos.Text); k.perintah.Parameters.AddWithValue("@6", txt_deskripsi.Text); k.perintah.ExecuteNonQuery(); k.close(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Diubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("error " + ex.ToString()); } }
private void btn_ubah_Click(object sender, RoutedEventArgs e) { DateTime tgllahir = dp_tgllahir.SelectedDate.Value; String jk = ""; if (rb_laki.IsChecked == true) { jk = "Laki - Laki"; } else { jk = "Perempuan"; } try { k.sql = "update siswa set nisn = '" + txt_nisn.Text + "',nama = '" + txt_nama.Text + "',jenis_kelamin = '" + jk + "',tgl_lahir = '" + tgllahir.ToString("MM-dd-yyyy") + "',alamat='" + txt_alamat.Text + "',tempat_lahir='" + txt_tempatlahir.Text + "',agama='" + cmb_agama.Text + "',foto=bulkcolumn from openrowset(bulk'" + alamat_foto + "',single_blob) as gambar where nis = '" + txt_nis.Text + "'"; k.setdt(); } catch (Exception ex) { //MessageBox.Show(ex.ToString()); k.sql = "update siswa set nisn = '" + txt_nisn.Text + "',nama = '" + txt_nama.Text + "',jenis_kelamin = '" + jk + "',tgl_lahir = '" + tgllahir.ToString("MM-dd-yyyy") + "',alamat='" + txt_alamat.Text + "',tempat_lahir='" + txt_tempatlahir.Text + "',agama='" + cmb_agama.Text + "' where nis = '" + txt_nis.Text + "'"; k.setdt(); } //MessageBox.Show("Data Berhasil Di Ubah", "Pemberitahuan", MessageBoxButtons.OK, MessageBoxIcon.Information); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Di Ubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); bersih(); showdata(); }
private async void ExecuteAddOrderAsync(object obj) { ORDER.CAKE_IN_ORDERS.ToList().ForEach(x => { UpdateCakeAmount(x.CAKE_ID, (int)x.NUMBER); HomeScreenViewModel.Instance.updateCakeAmount(x.CAKE_ID, x.CAKE.CAKE_TYPE, (int)x.NUMBER); x.CAKE = null; }); //TODO !!!! using (var db = new CAKESTOREEntities()) { db.ORDERS.Add(ORDER); db.SaveChanges(); }; var SuccessMessage = new SampleMessageDialogViewModel { Message = "Hóa đơn hoàn tất" }; var view = new SampleMessageDialog { DataContext = SuccessMessage }; var result = await DialogHost.Show(view, MainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, SuccessMessageDialogClosingHandler); ORDER = new ORDER(); ORDER.TOTAL_PRICE = 0; ORDER.DATE_CREATE = DateTime.Now; }
private void btn_ubah_Click(object sender, RoutedEventArgs e) { int harga = int.Parse(lb_diskon.Content.ToString(), System.Globalization.NumberStyles.Currency); try { k.sql = "update tb_detail_katalog set diskon=@diskon,harga_diskon=@hardis where id_produk = '" + txt_idprod.Text + "'"; k.setparam(); k.perintah.Parameters.AddWithValue("@diskon", txt_diskon.Text); k.perintah.Parameters.AddWithValue("@hardis", harga); k.perintah.ExecuteNonQuery(); k.close(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Diubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("error " + ex.ToString()); } }
private void btn_cetak_Click(object sender, RoutedEventArgs e) { if (kueri != "") { try { k.sql = kueri; k.setdt(); var ctk = new CetakNilai(); ctk.SetDataSource((DataTable)k.dt); var wctk = new w_Cetak(); wctk.ReportViewer1.ViewerCore.ReportSource = ctk; wctk.ShowDialog(); } catch (Exception err) { Console.WriteLine("{0} Exception caught.", err); } } else { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Nilai Belum Ditampilkan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_kdkls.Text == "" || txt_namakls.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "MsgDialogKelas"); } else { try { k.sql = "insert into kelas select '" + txt_kdkls.Text + "','" + txt_namakls.Text + "'"; k.setdt(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "SecondDialog"); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } } }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_kdbarang.Text == "" || txt_namabarang.Text == "" || txt_merk.Text == "" || cmb_kategori.Text == "" || txt_hargabarang.Text == "" || txt_stok.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } else { try { k.sql = "insert into tb_barang select '" + txt_kdbarang.Text + "','" + txt_namabarang.Text + "','" + txt_merk.Text + "','" + cmb_kategori.Text + "','" + txt_hargabarang.Text + "','" + txt_stok.Text + "'"; k.setdt(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); showdata(); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } } }
private void btn_bayar_Click(object sender, RoutedEventArgs e) { int tunai = int.Parse(txt_tunai.Text, System.Globalization.NumberStyles.Currency); kembali = int.Parse(txt_kembali.Text, System.Globalization.NumberStyles.Currency); try { k.sql = "insert into pembayaran values(@1,@2,@3,@4,@5,@6,@7)"; k.setparam(); k.perintah.Parameters.AddWithValue("@1", txt_invoice.Text); k.perintah.Parameters.AddWithValue("@2", tglBayar.ToString("yyyy-MM-dd")); k.perintah.Parameters.AddWithValue("@3", total); k.perintah.Parameters.AddWithValue("@4", noSewa); k.perintah.Parameters.AddWithValue("@5", 1); k.perintah.Parameters.AddWithValue("@6", tunai); k.perintah.Parameters.AddWithValue("@7", kembali); k.perintah.ExecuteNonQuery(); k.close(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } }
private void btn_ubah_Click(object sender, RoutedEventArgs e) { try { k.sql = "update tb_message set message=@message,alert=@alert where id_message = '" + txt_id.Text + "'"; k.setparam(); k.perintah.Parameters.AddWithValue("@message", txt_msg.Text); k.perintah.Parameters.AddWithValue("@alert", txt_alert.Text); k.perintah.ExecuteNonQuery(); k.close(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Diubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("error " + ex.ToString()); } }
private void btn_ubah_Click(object sender, RoutedEventArgs e) { try { int biaya = int.Parse(txt_biaya.Text, System.Globalization.NumberStyles.Currency); k.sql = "update kamar set nomor_kamar=@1,biaya=@2,status=@3, luas_kamar=@4 where id_kamar = '" + idKamar + "'"; k.setparam(); k.perintah.Parameters.AddWithValue("@1", txt_nama.Text); k.perintah.Parameters.AddWithValue("@2", biaya); k.perintah.Parameters.AddWithValue("@3", cmb_status.SelectedIndex); k.perintah.Parameters.AddWithValue("@4", txt_luas.Text); k.perintah.ExecuteNonQuery(); k.close(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Diubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("error " + ex.ToString()); } }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_host.Text == "" || txt_port.Text == "" || txt_dbname.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "SubDialogDB"); } else { try { k.setDB(); k.res.Rows[0][0] = txt_host.Text; k.res.Rows[0][1] = txt_port.Text; k.res.Rows[0][2] = txt_dbname.Text; k.res.Rows[0][3] = txt_username.Text; k.res.Rows[0][4] = txt_password.Text; k.saveSetting(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Pengaturan Koneksi Berhasil Diubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("error " + ex); } } }
private void btn_ubah_Click(object sender, RoutedEventArgs e) { DateTime tglujian = dp_tglul.SelectedDate.Value; String tipe = ""; if (rb_teori.IsChecked == true) { tipe = "Teori"; } else { tipe = "Praktek"; } try { k.sql = "update nilai set tanggal = '" + tglujian.ToString("MM-dd-yyyy") + "',kd_mapel = '" + cmb_mapel.SelectedValue + "',jenis = '" + cmb_jenis.Text + "',tipe_ujian = '" + tipe + "',nilai='" + txt_nilai.Text + "',grade='" + txt_grade.Text + "' where kd_nilai = '" + txt_kdnilai.Text + "'"; k.setdt(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Di Ubah" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); bersih(); showdatanilai(); }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_id.Text == "" || txt_deskripsi.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } else { try { k.sql = "insert into tb_katalog select '" + txt_id.Text + "','" + txt_deskripsi.Text + "'"; k.setdt(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); showdataktlog(); bersih(); kodeotomatis(); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } } }
private async void MenuPopupButton_OnClick(object sender, RoutedEventArgs e) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = ((ButtonBase)sender).Content.ToString() } }; await DialogHost.Show(sampleMessageDialog, "RootDialog"); }
private void btn_reg_Click(object sender, RoutedEventArgs e) { if (txt_nip.Text == "" || txt_nama.Text == "" || txt_nohp.Text == "" || txt_alamat.Text == "" || txt_tempatlahir.Text == "" || dp_tgllahir.Text == "" || cmb_agama.Text == "" || cmb_jabatan.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "RegDialog"); } else if (img_foto.Source == null) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Harap Masukan Foto" } }; DialogHost.Show(sampleMessageDialog, "RegDialog"); } else if (txt_username.Text == "" || txt_password.Password == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Harap Masukan Username dan Password" } }; DialogHost.Show(sampleMessageDialog, "RegDialog"); } else { try { DateTime tglahir = dp_tgllahir.SelectedDate.Value; String jk = ""; if (rb_laki.IsChecked == true) { jk = "Laki - Laki"; } else { jk = "Perempuan"; } k.sql = "insert into pegawai select '" + txt_nip.Text + "','" + txt_nama.Text + "','" + jk + "','" + tglahir.ToString("MM-dd-yyyy") + "','" + txt_alamat.Text + "','" + txt_tempatlahir.Text + "','" + cmb_agama.Text + "','" + cmb_jabatan.Text + "','" + txt_nohp.Text + "',bulkcolumn from openrowset(bulk'" + alamat_foto + "',single_blob) as gambar"; k.setdt(); k.sql = "insert into akun values('" + txt_username.Text + "','" + txt_password.Password + "','" + txt_nip.Text + "','admin')"; k.setdt(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Akun Berhasil Ditambahkan, Silahkan Login!" } }; DialogHost.Show(sampleMessageDialog, "RegDialog", ClosingEventHandler); } catch (Exception ex) { MessageBox.Show("Akun Gagal Didaftarkan " + ex); } } }
public static void ShowPopup(string message) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = (message) } }; DialogHost.Show(sampleMessageDialog, "RootDialog"); }
public async void RunCode() { var view = new SampleMessageDialog(); view.MessageStr = "测试"; //show the dialog var result = await DialogHost.Show(view, "RootDialog"); }
private async void btn_test_ClickAsync(object sender, RoutedEventArgs e) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "username atau password salah" } }; await DialogHost.Show(sampleMessageDialog, "RootDialog"); }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_nama.Text == "" || txt_telp.Text == "" || txt_asalkota.Text == "" || txt_nik.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "SubDialogCustomer"); } else { try { String jk = ""; if (rb_laki.IsChecked == true) { jk = "P"; } else { jk = "W"; } DateTime tgllahir = tgl_lahir.SelectedDate.Value; var img = ByteImageConverter.ConvertBitmapSourceToByteArray(img_foto.Source); k.sql = "insert into customer values(@1,@2,@3,@4,@5,@6,@7,@8,@9,@10,@11,@12)"; k.setparam(); k.perintah.Parameters.AddWithValue("@1", null); k.perintah.Parameters.AddWithValue("@2", txt_nik.Text); k.perintah.Parameters.AddWithValue("@3", txt_nama.Text); k.perintah.Parameters.AddWithValue("@4", txt_telp.Text); k.perintah.Parameters.AddWithValue("@5", jk); k.perintah.Parameters.AddWithValue("@6", tgllahir.ToString("yyyy-MM-dd")); k.perintah.Parameters.AddWithValue("@7", txt_asalkota.Text); k.perintah.Parameters.AddWithValue("@8", txt_alamat.Text); k.perintah.Parameters.AddWithValue("@9", cmb_pekerjaan.Text); k.perintah.Parameters.AddWithValue("@10", txt_instansi.Text); k.perintah.Parameters.AddWithValue("@11", img); k.perintah.Parameters.AddWithValue("@12", 0); k.perintah.ExecuteNonQuery(); k.close(); DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } } }
private async void MenuPopupButton_OnClick(object sender, RoutedEventArgs e) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Hello" } }; await DialogHost.Show(sampleMessageDialog, "ViewShowRootDialog"); }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_nip.Text == "" || txt_nama.Text == "" || txt_nohp.Text == "" || txt_alamat.Text == "" || txt_tempatlahir.Text == "" || dp_tgllahir.Text == "" || cmb_agama.Text == "" || cmb_jabatan.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "MsgDialog"); } else if (img_foto.Source == null) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Harap Masukan Foto" } }; DialogHost.Show(sampleMessageDialog, "MsgDialog"); } else { try { DateTime tglahir = dp_tgllahir.SelectedDate.Value; String jk = ""; if (rb_laki.IsChecked == true) { jk = "Laki - Laki"; } else { jk = "Perempuan"; } k.sql = "insert into pegawai select '" + txt_nip.Text + "','" + txt_nama.Text + "','" + jk + "','" + tglahir.ToString("MM-dd-yyyy") + "','" + txt_alamat.Text + "','" + txt_tempatlahir.Text + "','" + cmb_agama.Text + "','" + cmb_jabatan.Text + "','" + txt_nohp.Text + "',bulkcolumn from openrowset(bulk'" + alamat_foto + "',single_blob) as gambar"; k.setdt(); if (txt_username.Text != "" && txt_password.Password != "") { k.sql = "insert into akun values('" + txt_username.Text + "','" + txt_password.Password + "','" + txt_nip.Text + "','" + cmb_jabatan.Text + "')"; k.setdt(); } DialogHost.CloseDialogCommand.Execute(null, this); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "SecondDialog"); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } } }
/// <summary> /// Shows the message delete record. /// </summary> /// <param name="sucess">if set to <c>true</c> [sucess].</param> /// <param name="message">The message.</param> public static void ShowMessageDeleteRecord(bool sucess, string message) { var sampleMessageDialog = new SampleMessageDialog { PackIcon = { Kind = sucess ? PackIconKind.CheckCircleOutline : PackIconKind.CloseCircleOutline }, Message = { Text = string.IsNullOrEmpty(message) ? "Delete record" : message } }; DialogHost.Show(sampleMessageDialog, "RootDialog"); }
private void btn_backup_Click(object sender, RoutedEventArgs e) { k.backupDB(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Database Berhasil di simpan ke file BackupDatabase.sql" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); }
private void btn_restore_Click(object sender, RoutedEventArgs e) { k.restoreDB(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Database Berhasil di Kembalikan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); }
private void btn_simpan_Click(object sender, RoutedEventArgs e) { if (txt_id.Text == "" || txt_nama.Text == "" || txt_harga.Text == "") { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Lengkapi Dulu Data" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); } else { try { String jenis = ""; int harga = int.Parse(txt_harga.Text, System.Globalization.NumberStyles.Currency); if (rb_makanan.IsChecked == true) { jenis = "Makanan"; } else { jenis = "Minuman"; } var img = ByteImageConverter.ConvertBitmapSourceToByteArray(img_foto.Source); k.sql = "insert into tb_produk values(@id,@nama,@jenis,@detail,@harga,@foto)"; k.setparam(); k.perintah.Parameters.AddWithValue("@id", txt_id.Text); k.perintah.Parameters.AddWithValue("@nama", txt_nama.Text); k.perintah.Parameters.AddWithValue("@detail", txt_detail.Text); k.perintah.Parameters.AddWithValue("@jenis", jenis); k.perintah.Parameters.AddWithValue("@harga", harga); k.perintah.Parameters.AddWithValue("@foto", img); k.perintah.ExecuteNonQuery(); k.close(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Tersimpan" } }; DialogHost.Show(sampleMessageDialog, "MainDialog"); showdata(); bersih(); kodeotomatis(); } catch (Exception ex) { MessageBox.Show("Data Gagal Didaftarkan " + ex); } } }
private async void MostrarInformacion() { var sampleMessageDialog = new SampleMessageDialog() { Message = { Text = "Programa Desarrollado por: \n" + "Alex Geovany Soler Chavarria\n\n" + "Correo: [email protected]\n" + "Telefono: +504 9750-8879" } }; await DialogHost.Show(sampleMessageDialog, "RootDialog"); }
private void btn_masukansis_Click(object sender, RoutedEventArgs e) { k.sql = "update siswa set kd_kelas='" + kdkelas + "' where nis='" + nis + "'"; k.setdt(); showsiswa(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Siswa berhasil dimasukan ke Kelas : " + kdkelas } }; DialogHost.Show(sampleMessageDialog, "SecondDialog"); bersih2(); }
private async void buttonUndo_Click(object sender, RoutedEventArgs e) { if (lastItemSource == null) { var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "还没有做过任何修改哦~" } }; await DialogHost.Show(sampleMessageDialog, "RootDialog"); return; } SetNewData(lastItemSource); }
private void btn_yes_Click(object sender, RoutedEventArgs e) { k.sql = "delete from kamar where id_kamar = '" + idKamar + "'"; k.setdt(); var sampleMessageDialog = new SampleMessageDialog { Message = { Text = "Data Berhasil Di Hapus" } }; DialogHost.CloseDialogCommand.Execute(null, this); DialogHost.Show(sampleMessageDialog, "MainDialog"); }
private async void ExecuteRunDialog(object o) { //let's set up a little MVVM, cos that's what the cool kids are doing: var view = new SampleMessageDialog { DataContext = new LoginViewModel() }; //show the dialog var result = await DialogHost.Show(view, "RootDialog", ClosingEventHandler); //check the result... Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL")); }