bool SaveLogDetail(frmTaskMonitoringEntry monitoring) { bool success = false; LogEntry logEntry = monitoring.LogEntry; if ((logEntry == null) || (string.IsNullOrEmpty(logEntry.Description))) { return(success); } this.View_SetRememberedSetting(monitoring.RememberSetting); this.View_SetRememberedDate(logEntry.Created); try { if (logEntry.System_Created == DateTime.MinValue) { logEntry.System_Created = DateTime.Now; } this.View_SaveRecord(logEntry); } catch (Exception ex) { throw ex; } this.View_QueryRecords(null); this.RefreshDashboardData(); success = true; return(success); }
void PromptMonitoring() { try { if (this._promptingInProgress) { return; } this._promptingInProgress = true; using (frmTaskMonitoringEntry monitoring = new frmTaskMonitoringEntry( this.View_GetCategories() .Select(x => x.Name), this.View_GetRememberedSetting(), this.View_GetRememberedDate(), this.txtObjectives.Text ) ) { DialogResult result = monitoring.ShowDialog(this); if (result != System.Windows.Forms.DialogResult.OK) { return; } this.SaveLogDetail(monitoring); monitoring.Dispose(); } } catch (Exception ex) { throw ex; } finally { this._promptingInProgress = false; } }
bool SaveLogDetail(frmTaskMonitoringEntry monitoring) { bool success = false; LogEntry logEntry = monitoring.LogEntry; if ((logEntry == null) || (string.IsNullOrEmpty(logEntry.Description))) return success; this.View_SetRememberedSetting(monitoring.RememberSetting); this.View_SetRememberedDate(logEntry.Created); try { if (logEntry.System_Created == DateTime.MinValue) logEntry.System_Created = DateTime.Now; this.View_SaveRecord(logEntry); } catch(Exception ex) { throw ex; } this.View_QueryRecords(null); this.RefreshDashboardData(); success = true; return success; }
void SafeEditEntry(int primaryKey, string category, string description, bool rememberSetting, DateTime createdDate, DateTime systemCreatedDate, DateTime rememberedCreatedDateTime, Double hoursRendered ) { this.StopTimer(); MethodInvoker invokeFromUI = new MethodInvoker( () => { try { if (this._promptingInProgress) return; this._promptingInProgress = true; this.View_GetObjectiveData(createdDate); using (frmTaskMonitoringEntry monitoring = new frmTaskMonitoringEntry( this.View_GetCategories() .Select(x => x.Name), primaryKey, category, description, rememberSetting, createdDate, systemCreatedDate, this.txtObjectives.Text, hoursRendered )) { DialogResult result = monitoring.ShowDialog(this); if (result != System.Windows.Forms.DialogResult.OK) return; this.SaveLogDetail(monitoring); monitoring.Dispose(); } } catch (Exception ex) { throw ex; } finally { this._promptingInProgress = false; } } ); if (this.InvokeRequired) this.Invoke(invokeFromUI); else invokeFromUI.Invoke(); this.RestartTimer(); }
void PromptMonitoring() { try { if (this._promptingInProgress) return; this._promptingInProgress = true; using (frmTaskMonitoringEntry monitoring = new frmTaskMonitoringEntry( this.View_GetCategories() .Select(x => x.Name), this.View_GetRememberedSetting(), this.View_GetRememberedDate(), this.txtObjectives.Text ) ) { DialogResult result = monitoring.ShowDialog(this); if (result != System.Windows.Forms.DialogResult.OK) return; this.SaveLogDetail(monitoring); monitoring.Dispose(); } } catch(Exception ex) { throw ex; } finally { this._promptingInProgress = false; } }
void SafeEditEntry(int primaryKey, string category, string description, bool rememberSetting, DateTime createdDate, DateTime systemCreatedDate, DateTime rememberedCreatedDateTime, Double hoursRendered ) { this.StopTimer(); MethodInvoker invokeFromUI = new MethodInvoker( () => { try { if (this._promptingInProgress) { return; } this._promptingInProgress = true; this.View_GetObjectiveData(createdDate); using (frmTaskMonitoringEntry monitoring = new frmTaskMonitoringEntry( this.View_GetCategories() .Select(x => x.Name), primaryKey, category, description, rememberSetting, createdDate, systemCreatedDate, this.txtObjectives.Text, hoursRendered )) { DialogResult result = monitoring.ShowDialog(this); if (result != System.Windows.Forms.DialogResult.OK) { return; } this.SaveLogDetail(monitoring); monitoring.Dispose(); } } catch (Exception ex) { throw ex; } finally { this._promptingInProgress = false; } } ); if (this.InvokeRequired) { this.Invoke(invokeFromUI); } else { invokeFromUI.Invoke(); } this.RestartTimer(); }