public override int GetHashCode() { unchecked { var hashCode = 1561563491; hashCode = (hashCode * 157) + Id.GetHashCode(); hashCode = (hashCode * 157) + WorkflowID.GetHashCode(); hashCode = (hashCode * 157) + ExecutionID.GetHashCode(); hashCode = (hashCode * 157) + ExecutionOrigin.GetHashCode(); hashCode = (hashCode * 157) + IsSubExecution.GetHashCode(); hashCode = (hashCode * 157) + IsRemoteWorkflow.GetHashCode(); hashCode = (hashCode * 157) + WorkflowName.GetHashCode(); hashCode = (hashCode * 157) + AuditType.GetHashCode(); hashCode = (hashCode * 157) + PreviousActivity.GetHashCode(); hashCode = (hashCode * 157) + PreviousActivityType.GetHashCode(); hashCode = (hashCode * 157) + PreviousActivityId.GetHashCode(); hashCode = (hashCode * 157) + NextActivity.GetHashCode(); hashCode = (hashCode * 157) + NextActivityType.GetHashCode(); hashCode = (hashCode * 157) + NextActivityId.GetHashCode(); hashCode = (hashCode * 157) + ServerID.GetHashCode(); hashCode = (hashCode * 157) + ParentID.GetHashCode(); hashCode = (hashCode * 157) + ExecutingUser.GetHashCode(); hashCode = (hashCode * 157) + ExecutionOriginDescription.GetHashCode(); hashCode = (hashCode * 157) + ExecutionToken.GetHashCode(); hashCode = (hashCode * 157) + AdditionalDetail.GetHashCode(); hashCode = (hashCode * 157) + Environment.GetHashCode(); hashCode = (hashCode * 157) + AuditDate.GetHashCode(); return(hashCode); } }
/// <summary> /// Inserts the workflow parameters passed in the argument into the database. /// </summary> /// <param name="parameters">The parameters collection to insert</param> public void Insert(Hashtable parameters) { //Can't insert no parameters. if (parameters == null || parameters.Count <= 0) { return; } if (_connectionString == String.Empty || _connectionString == null) { throw new Exception("Invalid connection string. Cannot be empty or null."); } DataManager.ConnectionString = _connectionString; using (DataManager.Current.OpenConnection()) { IDictionaryEnumerator ide = parameters.GetEnumerator(); ide.Reset(); while (ide.MoveNext()) { string sql = "INSERT INTO WorkflowParameters (WorkflowID, WorkflowParameterName, WorkflowParameterValue) "; sql += "VALUES(" + WorkflowID.ToString() + ",'" + ide.Key.ToString() + "','" + ide.Value.ToString() + "')"; SqlCommand cmd = DataManager.CreateCommand(sql); cmd.ExecuteNonQuery(); } } }
public bool Equals(ISimulationKey other) { if (other == null) { return(false); } return(WorkflowID.Equals(other.WorkflowID) && ActivityID.Equals(other.ActivityID) && ScenarioID.Equals(other.ScenarioID)); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> public override int GetHashCode() { unchecked { var hashCode = (WorkflowID != null ? WorkflowID.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ActivityID != null ? ActivityID.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ScenarioID != null ? ScenarioID.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> public override int GetHashCode() { unchecked { var hashCode = WorkflowID?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (ActivityID?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (ScenarioID?.GetHashCode() ?? 0); return(hashCode); } }
/// <summary> /// Deletes the collection of parameters related to this specific workflow ID from /// the database. /// </summary> public void Delete() { if (_connectionString == String.Empty || _connectionString == null) { throw new Exception("Invalid connection string. Cannot be empty or null."); } DataManager.ConnectionString = _connectionString; using (DataManager.Current.OpenConnection()) { string sql = "DELETE WorkflowParameters WHERE WorkflowID = " + WorkflowID.ToString(); SqlCommand del = DataManager.CreateCommand(sql); del.ExecuteNonQuery(); } }
private async void SaveDataAsync() { // Confirm session is still active if (sessionData.IsSessionTimedOut) { _ = await dialogCoordinator.ShowMessageAsync(this, "Alert!", "Your RPD session has expired please log in again.", MessageDialogStyle.Affirmative); ReturnToLogin(); return; } // Check user hasn't pasted in any non-numeric characters if (WorkflowID.IsNotNumeric()) { _ = await dialogCoordinator.ShowMessageAsync(this, "Alert!", "Non-numeric characters entered in run number", MessageDialogStyle.Affirmative); return; } HalFileInfo info = new HalFileInfo(SelectedSite, WorkflowID); CommandResult result = submitHalFile.Execute(info); if (result.IsError) { // Display error dialog _ = await dialogCoordinator.ShowMessageAsync(this, "Error!", result.ErorrMessage, MessageDialogStyle.Affirmative); return; } // Display success dialog _ = await dialogCoordinator.ShowMessageAsync(this, "Information!", info.ToString(), MessageDialogStyle.Affirmative); // Update the session timeout sessionData.UpdateTimeStamp(); // Clear data SelectedSite = null; WorkflowID = null; }