Skip to content

Commit

Permalink
A few changes were made to DataTier.NET v5.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
DataJuggler committed Jan 28, 2025
1 parent cda5582 commit e79e8fe
Show file tree
Hide file tree
Showing 8 changed files with 341 additions and 108 deletions.
11 changes: 9 additions & 2 deletions DataTier.Net/Client/Controls/ConfirmChangesControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private void ConfirmUpdateButton_Click(object sender, EventArgs e)
UpdateStatus(listItem, gatewayUpdated);

// if all 3 files were updated
if (dataObjectUpdated && writerUpdated && gatewayUpdated)
if (dataObjectUpdated && writerUpdated)
{
// now we need to insert a method into the methods table

Expand Down Expand Up @@ -2456,7 +2456,9 @@ public bool UpdateGateway()
string setParameterFieldValue = "";

// if the file exists
if ((File.Exists(gatewayFile)) && (MethodInfo != null) && (MethodInfo.HasSelectedTable))
bool fileExists = File.Exists(gatewayFile);

if ((fileExists) && (MethodInfo != null) && (MethodInfo.HasSelectedTable))
{
// convert the DTN Field back to a DataField
DataField parameterField = DataConverter.ConvertDataField(MethodInfo.ParameterField);
Expand Down Expand Up @@ -2879,6 +2881,11 @@ public bool UpdateGateway()
// the gateway file was updated
updated = true;
}
else
{
// Update: 1.28.2025: The Gateway already has this method, so no need to abort
updated = true;
}
}

// return value
Expand Down
46 changes: 38 additions & 8 deletions DataTier.Net/Client/Controls/NewStoredProcedureEditor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions DataTier.Net/Client/Controls/NewStoredProcedureEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,15 @@ public void OnSave()
public void Setup(MethodInfo methodInfo, Project openProject, CustomReader customReader = null, DTNField orderByField = null, FieldSet orderByFieldSet = null)
{
// store the args
this.MethodInfo = methodInfo;
this.OpenProject = openProject;
MethodInfo = methodInfo;
OpenProject = openProject;

// if the OpenProject exists
if ((HasOpenProject) && (ListHelper.HasOneOrMoreItems(OpenProject.Databases)))
{
// Set the Database Name
DatabaseNameControl.Text = OpenProject.Databases[0].DatabaseName;
}

// locals
DataJuggler.Net.DataField parameter = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


#region using statements

using DataAccessComponent.StoredProcedureManager.DeleteProcedures;
Expand All @@ -13,7 +12,6 @@

#endregion


namespace DataAccessComponent.Data.Writers
{

Expand All @@ -27,10 +25,48 @@ public class ProjectWriter : ProjectWriterBase

#region Static Methods

// *******************************************
// Write any overrides or custom methods here.
// *******************************************
#region CreateFindProjectStoredProcedure(Project project)
/// <summary>
/// This method creates an instance of a
/// 'FindProjectStoredProcedure' object and
/// creates the sql parameter[] array needed
/// to execute the procedure 'Project_Find'.
/// </summary>
/// <param name="project">The 'Project' to use to
/// get the primary key parameter.</param>
/// <returns>An instance of an FetchUserStoredProcedure</returns>
public static new FindProjectStoredProcedure CreateFindProjectStoredProcedure(Project project)
{
// Initial Value
FindProjectStoredProcedure findProjectStoredProcedure = null;

// verify project exists
if(project != null)
{
// Instanciate findProjectStoredProcedure
findProjectStoredProcedure = new FindProjectStoredProcedure();

// if project.FindByProjectName is true
if (project.FindByProjectName)
{
// Change the procedure name
findProjectStoredProcedure.ProcedureName = "Project_FindByProjectName";

// Create the @ProjectName parameter
findProjectStoredProcedure.Parameters = SqlParameterHelper.CreateSqlParameters("@ProjectName", project.ProjectName);
}
else
{
// Now create parameters for this procedure
findProjectStoredProcedure.Parameters = CreatePrimaryKeyParameter(project);
}
}

// return value
return findProjectStoredProcedure;
}
#endregion

#endregion

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,32 @@ public Project FindProject(int projectId, Project tempProject = null)
}
#endregion

#region FindProjectByProjectName(string projectName)
/// <summary>
/// This method is used to find 'Project' objects for the ProjectName given.
/// </summary>
public Project FindProjectByProjectName(string projectName)
{
// initial value
Project project = null;

// Create a temp Project object
Project tempProject = new Project();

// Set the value for FindByProjectName to true
tempProject.FindByProjectName = true;

// Set the value for ProjectName
tempProject.ProjectName = projectName;

// Perform the find
project = FindProject(0, tempProject);

// return value
return project;
}
#endregion

#region FindProjectReference(int referencesId, ProjectReference tempProjectReference = null)
/// <summary>
/// This method is used to find 'ProjectReference' objects.
Expand Down Expand Up @@ -1848,6 +1874,7 @@ public string ConnectionName
/// </summary>
public DataManager DataManager
{

get
{
// initial value
Expand Down
Loading

0 comments on commit e79e8fe

Please sign in to comment.