private void radButton1_Click(object sender, EventArgs e) { int index_id, index_day, index_kategori, index_month, index_tk_keamanan, index_year; string index_start; int.TryParse(ddIdxId.Text, out index_id); int.TryParse(ddIdxIncludeDay.Text, out index_day); int.TryParse(ddIdxKategori.Text, out index_kategori); int.TryParse(ddIdxIncludeMonth.Text, out index_month); int.TryParse(ddIdxTKKeamanan.Text, out index_tk_keamanan); int.TryParse(ddIdxIncludeYear.Text, out index_year); if (rdoFlat.IsChecked) { index_start = rdoFlat.Text; } else { index_start = rdoMessage.Text; } try { string str_surat = ""; if (rdoSuratMasuk.IsChecked) { str_surat = "surat_masuk"; } else { str_surat = "surat_keluar"; } AppDefaultSetting.UpdateSetting(this.concat_nomor_agenda, ddFormatDay.Text, ddFormatMonth.Text, ddFormatYear.Text, lblNomorAgenda.Text, chkIncludeDay.Checked, chkKategori.Checked, chkIncludeMonth.Checked, chkTkKeamanan.Checked, chkIncludeYear.Checked, index_id, index_day, index_kategori, index_month, index_tk_keamanan, index_year, (int)nIDLen.Value, ddReset.Text, chkReset.Checked, index_start, str_surat); MessageBox.Show(this, "Format:" + lblNomorAgenda.Text + " nomor agenda sudah digenerate."); } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SaveSetting() { try { string _disposisi_template_path = txtDisposisiFile.Text.Replace("\\", "\\\\"); string _penyelesaian_template_file = txtPenyelesaianFile.Text.Replace("\\", "\\\\"); string _surat_keluar_template_file = txtSuratKeluar.Text.Replace("\\", "\\\\"); string _date_format = ddDateFormat.Text; string _option_highlight; _option_highlight = GetOptionHighlight(); AppDefaultSetting.UpdateLayoutPrintoutSetting(_disposisi_template_path, _penyelesaian_template_file, _date_format, _option_highlight, _surat_keluar_template_file); MessageBox.Show(this, "Data sudah di simpan.", "Data disimpan", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } catch (Exception ex) { MessageBox.Show(this, "Terdapat kesalah, mohon periksa kembali.", "Duplicate Data", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }