private void CapNhatCTTM() { try { QLThuChi.Dao.ThuChi.chungtutienmatRow row = (QLThuChi.Dao.ThuChi.chungtutienmatRow)((DataRowView)this.chungtutienmatBindingSource.Current).Row; row.UserId = this.UserId; this.chungtutienmatBindingSource.EndEdit(); this.thuChi.chungtutienmat.GetChanges(); this.chungtutienmatTableAdapter.Update(this.thuChi.chungtutienmat); this.thuChi.chungtutienmat.AcceptChanges(); } catch (Exception ex) { MessageBox.Show("Xuất hiện lỗi trong khi cập nhật dữ liệu. Xin vui lòng thử lại.", "Error", MessageBoxButtons.OK); TraceListenerLogger.Error(ex); } }
/// <summary> /// Load global configurations. /// </summary> private static void Init() { Logger = new TraceListenerLogger(); // Load saved state try { _singleInstance = AppSettings.Get <bool>(Constants.Settings.SingleInstance); var sqlLogLevel = AppSettings.Get <bool>(Constants.Settings.SqlLoggingEnabled) ? LogLevel.All : LogLevel.None; var sqlLogRetention = AppSettings.Get <int?>(Constants.Settings.SqlLoggingRetention); var sqlLogDirectory = AppSettings.GetOrDefault(Constants.Settings.SqlLoggingDirectory, Path.GetFullPath(Path.Combine(DataDirectory, Constants.Defaults.SqlLoggingDirectory))); SqlLogger = new SqlLogger(sqlLogDirectory, sqlLogRetention, sqlLogLevel); } catch (Exception e) { Logger.Warn($"Failed to apply AppSettings. Error: {e}"); } }