Added Swarmops.Common for interfaces and enums, for cleaner dependencies
This commit is contained in:
+3
-1
@@ -15,7 +15,7 @@
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
@@ -60,6 +60,8 @@
|
||||
<Compile Include="Enums\OrganizationFinancialAccountType.cs" />
|
||||
<Compile Include="Enums\OutboundCommPriority.cs" />
|
||||
<Compile Include="Types\Governance\BasicBallot.cs" />
|
||||
<Compile Include="Types\Swarm\BasicPosition.cs" />
|
||||
<Compile Include="Types\Swarm\BasicPositionAssignment.cs" />
|
||||
<Compile Include="Types\System\BasicSwarmopsLogEntry.cs" />
|
||||
<Compile Include="Types\Communications\BasicOutboundComm.cs" />
|
||||
<Compile Include="Types\Communications\BasicOutboundCommRecipient.cs" />
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Swarmops.Basic.Interfaces;
|
||||
|
||||
namespace Swarmops.Basic.Types.Swarm
|
||||
{
|
||||
public class BasicPosition: IHasIdentity
|
||||
{
|
||||
public BasicPosition(int positionId, int organizationId, int positionLevel, int geographyId, bool overridable,
|
||||
int overridesHigherPositionId, int createdByPersonId, DateTime createdDateTimeUtc, int positionTypeId,
|
||||
bool inheritsDownward, bool volunteerable, bool active, bool covert, int reportsToPositionId,
|
||||
int dotReportsToPositionId, int minCount, int maxCount)
|
||||
{
|
||||
this.PositionId = positionId;
|
||||
this.OrganizationId = organizationId;
|
||||
this.PositionLevel = positionLevel;
|
||||
this.GeographyId = geographyId;
|
||||
this.Overridable = overridable;
|
||||
this.OverridesHigherPositionId = overridesHigherPositionId;
|
||||
this.CreatedByPersonId = createdByPersonId;
|
||||
this.CreatedDateTimeUtc = createdDateTimeUtc;
|
||||
this.PositionTypeId = positionTypeId;
|
||||
this.InheritsDownward = inheritsDownward;
|
||||
this.Volunteerable = volunteerable;
|
||||
this.Active = active;
|
||||
this.Covert = covert;
|
||||
this.ReportsToPositionId = reportsToPositionId;
|
||||
this.DotReportsToPositionId = dotReportsToPositionId;
|
||||
this.MinCount = minCount;
|
||||
this.MaxCount = maxCount;
|
||||
}
|
||||
|
||||
public BasicPosition (BasicPosition original)
|
||||
: this (
|
||||
original.PositionId, original.OrganizationId, original.PositionLevel, original.GeographyId, original.Overridable,
|
||||
original.OverridesHigherPositionId, original.CreatedByPersonId, original.CreatedDateTimeUtc, original.PositionTypeId,
|
||||
original.InheritsDownward, original.Volunteerable, original.Active,
|
||||
original.Covert, original.ReportsToPositionId, original.DotReportsToPositionId, original.MinCount,
|
||||
original.MaxCount)
|
||||
{
|
||||
// copy ctor
|
||||
}
|
||||
|
||||
public int PositionId { get; private set; }
|
||||
public int PositionLevel { get; private set; }
|
||||
public int OrganizationId { get; private set; }
|
||||
public int GeographyId { get; private set; }
|
||||
public bool Overridable { get; protected set; }
|
||||
public int OverridesHigherPositionId { get; protected set; }
|
||||
public int CreatedByPersonId { get; private set; }
|
||||
public DateTime CreatedDateTimeUtc { get; private set; }
|
||||
public int PositionTypeId { get; private set; }
|
||||
public bool InheritsDownward { get; protected set; }
|
||||
public bool Volunteerable { get; protected set; }
|
||||
public bool Active { get; protected set; }
|
||||
public bool Covert { get; protected set; }
|
||||
public int ReportsToPositionId { get; protected set; }
|
||||
public int DotReportsToPositionId { get; protected set; }
|
||||
public int MinCount { get; protected set; }
|
||||
public int MaxCount { get; protected set; }
|
||||
|
||||
public int Identity
|
||||
{
|
||||
get { return this.PositionId; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Swarmops.Basic.Types.Swarm
|
||||
{
|
||||
public class BasicPositionAssignment
|
||||
{
|
||||
public BasicPositionAssignment (int positionAssignmentId, int organizationId, int geographyId, int positionId,
|
||||
DateTime createdDateTimeUtc, int createdByPersonId, int createdByPositionId, bool active, DateTime expiresDateTimeUtc,
|
||||
DateTime terminatedDateTimeUtc, int terminatedByPersonId,
|
||||
int terminatedByPositionId, string assignmentNotes, string terminationNotes)
|
||||
{
|
||||
this.PositionAssignmentId = positionAssignmentId;
|
||||
this.OrganizationId = organizationId;
|
||||
this.GeographyId = geographyId;
|
||||
this.PositionId = positionId;
|
||||
this.CreatedDateTimeUtc = createdDateTimeUtc;
|
||||
this.CreatedByPersonId = createdByPersonId;
|
||||
this.CreatedByPositionId = createdByPositionId;
|
||||
this.Active = active;
|
||||
this.ExpiresDateTimeUtc = expiresDateTimeUtc;
|
||||
this.TerminatedDateTimeUtc = terminatedDateTimeUtc;
|
||||
this.TerminatedByPersonId = terminatedByPersonId;
|
||||
this.TerminatedByPositionId = terminatedByPositionId;
|
||||
this.AssignmentNotes = assignmentNotes;
|
||||
this.TerminationNotes = terminationNotes;
|
||||
}
|
||||
|
||||
public BasicPositionAssignment (BasicPositionAssignment original)
|
||||
: this (original.PositionAssignmentId, original.OrganizationId, original.GeographyId, original.PositionId,
|
||||
original.CreatedDateTimeUtc, original.CreatedByPersonId, original.CreatedByPositionId, original.Active,
|
||||
original.ExpiresDateTimeUtc, original.TerminatedDateTimeUtc, original.TerminatedByPersonId,
|
||||
original.TerminatedByPositionId, original.AssignmentNotes, original.TerminationNotes)
|
||||
{
|
||||
// copy ctor
|
||||
}
|
||||
|
||||
public int PositionAssignmentId { get; private set; }
|
||||
public int OrganizationId { get; private set; }
|
||||
public int GeographyId { get; private set; }
|
||||
public int PositionId { get; private set; }
|
||||
public DateTime CreatedDateTimeUtc { get; private set; }
|
||||
public int CreatedByPersonId { get; private set; }
|
||||
public int CreatedByPositionId { get; private set; }
|
||||
public bool Active { get; protected set; }
|
||||
public DateTime ExpiresDateTimeUtc { get; protected set; }
|
||||
public DateTime TerminatedDateTimeUtc { get; protected set; }
|
||||
public int TerminatedByPersonId { get; protected set; }
|
||||
public int TerminatedByPositionId { get; protected set; }
|
||||
public string AssignmentNotes { get; private set; }
|
||||
public string TerminationNotes { get; protected set; }
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
<configuration>
|
||||
<configSections>
|
||||
</configSections>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Swarmops.Common</RootNamespace>
|
||||
<AssemblyName>Swarmops.Common</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Swarmops.Common")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Swarmops")]
|
||||
[assembly: AssemblyCopyright("Public Domain")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("33f0a99a-5756-4c99-aa5a-ee4f481a6ee0")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+111
-48
@@ -83,8 +83,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Linq;
|
||||
using Swarmops.Basic.Types;
|
||||
using Swarmops.Basic.Types.Financial;
|
||||
using Swarmops.Basic.Types.Swarm;
|
||||
|
||||
namespace Swarmops.Database
|
||||
{
|
||||
@@ -107,60 +109,112 @@ namespace Swarmops.Database
|
||||
|
||||
private const string positionAssignmentFieldSequence =
|
||||
" PositionAssignmentId,OrganizationId,GeographyId,PositionId,PersonId," + // 0-4
|
||||
"ExpiresDateTimeUtc,CreatedDateTimeUtc,CreatedByPersonId,CreatedByPositionId,Active," + // 5-9
|
||||
"CreatedDateTimeUtc,CreatedByPersonId,CreatedByPositionId,Active,ExpiresDateTimeUtc," + // 5-9
|
||||
"TerminatedDateTimeUtc,TerminatedByPersonId,TerminatedByPositionId,AssignmentNotes,TerminationNotes" + // 10-14
|
||||
" FROM PositionAssignments ";
|
||||
|
||||
private static BasicRefund ReadStandardPositionFromDataReader(IDataRecord reader)
|
||||
private static BasicPosition ReadStandardPositionFromDataReader(IDataRecord reader)
|
||||
{
|
||||
int refundId = reader.GetInt32(0);
|
||||
int paymentId = reader.GetInt32(1);
|
||||
bool open = reader.GetBoolean(2);
|
||||
Int64 amountCents = reader.GetInt64(3);
|
||||
DateTime createdDateTime = reader.GetDateTime(4);
|
||||
DateTime closedDateTime = reader.GetDateTime(5);
|
||||
int createdByPersonId = reader.GetInt32(6);
|
||||
int standardPositionId = reader.GetInt32(0);
|
||||
int organizationId = reader.GetInt32 (1);
|
||||
int positionLevel = reader.GetInt32 (2);
|
||||
int positionTypeId = reader.GetInt32 (3);
|
||||
bool active = reader.GetBoolean (4);
|
||||
bool volunteerable = reader.GetBoolean (5);
|
||||
bool overridable = reader.GetBoolean (6);
|
||||
bool covert = reader.GetBoolean (7);
|
||||
int reportsToStandardPositionId = reader.GetInt32 (8);
|
||||
int dotReportsToStandardPositionId = reader.GetInt32 (9);
|
||||
int minCount = reader.GetInt32 (10);
|
||||
int maxCount = reader.GetInt32 (11);
|
||||
|
||||
return new BasicRefund(refundId, paymentId, open, amountCents, createdByPersonId, createdDateTime,
|
||||
closedDateTime);
|
||||
return new BasicPosition (standardPositionId, organizationId, positionLevel, 0 /*geographyId*/, overridable,
|
||||
0 /*overridesId*/, 0 /*createdByPerson*/, DateTime.MinValue /*createdDateTimeUtc*/, positionTypeId,
|
||||
true /*inheritsDownward*/, volunteerable, active, covert, reportsToStandardPositionId,
|
||||
dotReportsToStandardPositionId, minCount, maxCount);
|
||||
}
|
||||
|
||||
private static BasicRefund ReadAdditionalPositionFromDataReader(IDataRecord reader)
|
||||
private static BasicPosition ReadAdditionalPositionFromDataReader(IDataRecord reader)
|
||||
{
|
||||
int refundId = reader.GetInt32(0);
|
||||
int paymentId = reader.GetInt32(1);
|
||||
bool open = reader.GetBoolean(2);
|
||||
Int64 amountCents = reader.GetInt64(3);
|
||||
DateTime createdDateTime = reader.GetDateTime(4);
|
||||
DateTime closedDateTime = reader.GetDateTime(5);
|
||||
int createdByPersonId = reader.GetInt32(6);
|
||||
int additionalPositionId = reader.GetInt32 (0);
|
||||
int organizationId = reader.GetInt32 (1);
|
||||
int geographyId = reader.GetInt32 (2);
|
||||
int overridesHigherPositionId = reader.GetInt32 (3);
|
||||
int createdByPersonId = reader.GetInt32 (4);
|
||||
DateTime createdDateTimeUtc = reader.GetDateTime (5);
|
||||
int positionTypeId = reader.GetInt32 (6);
|
||||
bool inheritsDownward = reader.GetBoolean (7);
|
||||
bool volunteerable = reader.GetBoolean (8);
|
||||
bool active = reader.GetBoolean (9);
|
||||
bool covert = reader.GetBoolean (10);
|
||||
int reportsToStandardPositionId = reader.GetInt32 (11);
|
||||
int reportsToAdditionalPositionId = reader.GetInt32 (12);
|
||||
int dotReportsToStandardPositionId = reader.GetInt32 (13);
|
||||
int minCount = reader.GetInt32 (14);
|
||||
int maxCount = reader.GetInt32 (15);
|
||||
|
||||
int reportsToPositionId = (reportsToAdditionalPositionId != 0)
|
||||
? -reportsToAdditionalPositionId
|
||||
: reportsToStandardPositionId;
|
||||
|
||||
return new BasicPosition (-additionalPositionId, organizationId, 5 /*PositionLevel.Geographic*/,
|
||||
geographyId, false /*overridable*/, overridesHigherPositionId,
|
||||
createdByPersonId, createdDateTimeUtc, positionTypeId, inheritsDownward, volunteerable, active, covert,
|
||||
reportsToPositionId, dotReportsToStandardPositionId, minCount, maxCount);
|
||||
|
||||
return new BasicRefund(refundId, paymentId, open, amountCents, createdByPersonId, createdDateTime,
|
||||
closedDateTime);
|
||||
}
|
||||
|
||||
private static BasicRefund ReadPositionAssignmentFromDataReader(IDataRecord reader)
|
||||
private static BasicPositionAssignment ReadPositionAssignmentFromDataReader(IDataRecord reader)
|
||||
{
|
||||
int refundId = reader.GetInt32(0);
|
||||
int paymentId = reader.GetInt32(1);
|
||||
bool open = reader.GetBoolean(2);
|
||||
Int64 amountCents = reader.GetInt64(3);
|
||||
DateTime createdDateTime = reader.GetDateTime(4);
|
||||
DateTime closedDateTime = reader.GetDateTime(5);
|
||||
int createdByPersonId = reader.GetInt32(6);
|
||||
int positionAssigmentId = reader.GetInt32 (0);
|
||||
int organizationId = reader.GetInt32 (1); // this field is necessary because assignment can be to a suborg of the position record
|
||||
int geographyId = reader.GetInt32 (2);
|
||||
int positionId = reader.GetInt32 (3);
|
||||
int personId = reader.GetInt32 (4);
|
||||
DateTime createdDateTimeUtc = reader.GetDateTime (5);
|
||||
int createdByPersonId = reader.GetInt32 (6);
|
||||
int createdByPositionId = reader.GetInt32 (7);
|
||||
bool active = reader.GetBoolean (8);
|
||||
DateTime expiresDateTimeUtc = reader.GetDateTime (9);
|
||||
DateTime terminatedDateTimeUtc = reader.GetDateTime (10);
|
||||
int terminatedByPersonId = reader.GetInt32 (11);
|
||||
int terminatedByPositionId = reader.GetInt32 (12);
|
||||
string assignmentNotes = reader.GetString (13);
|
||||
string terminationNotes = reader.GetString (14);
|
||||
|
||||
return new BasicRefund(refundId, paymentId, open, amountCents, createdByPersonId, createdDateTime,
|
||||
closedDateTime);
|
||||
return new BasicPositionAssignment (positionAssigmentId, organizationId, geographyId, positionId,
|
||||
createdDateTimeUtc, createdByPersonId, createdByPositionId, active, expiresDateTimeUtc,
|
||||
terminatedDateTimeUtc, terminatedByPersonId, terminatedByPositionId, assignmentNotes, terminationNotes);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Database record reading -- SELECT clauses
|
||||
|
||||
public BasicPosition GetPosition (int positionId)
|
||||
{
|
||||
if (positionId > 0)
|
||||
{
|
||||
return GetStandardPosition (positionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetAdditionalPosition (-positionId);
|
||||
}
|
||||
}
|
||||
|
||||
public BasicPosition[] GetPositions (params object[] conditions)
|
||||
{
|
||||
BasicPosition[] standardHits = GetStandardPositions (conditions);
|
||||
BasicPosition[] additionalHits = GetAdditionalPositions (conditions);
|
||||
|
||||
return standardHits.Concat (additionalHits).ToArray();
|
||||
|
||||
}
|
||||
|
||||
#region Standard Positions
|
||||
|
||||
public BasicRefund GetStandardPosition (int standardPositionId)
|
||||
public BasicPosition GetStandardPosition (int standardPositionId)
|
||||
{
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
@@ -175,7 +229,7 @@ namespace Swarmops.Database
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return ReadRefundFromDataReader(reader);
|
||||
return ReadStandardPositionFromDataReader(reader);
|
||||
}
|
||||
|
||||
throw new ArgumentException("No such StandardPositionId:" + standardPositionId);
|
||||
@@ -184,9 +238,9 @@ namespace Swarmops.Database
|
||||
}
|
||||
|
||||
|
||||
public BasicRefund[] GetStandardPositions(params object[] conditions)
|
||||
public BasicPosition[] GetStandardPositions(params object[] conditions)
|
||||
{
|
||||
List<BasicRefund> result = new List<BasicRefund>();
|
||||
List<BasicPosition> result = new List<BasicPosition>();
|
||||
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
@@ -200,7 +254,7 @@ namespace Swarmops.Database
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(ReadRefundFromDataReader(reader));
|
||||
result.Add(ReadStandardPositionFromDataReader(reader));
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
@@ -213,7 +267,7 @@ namespace Swarmops.Database
|
||||
|
||||
#region Additional Positions
|
||||
|
||||
public BasicRefund GetAdditionalPosition(int additionalPositionId)
|
||||
public BasicPosition GetAdditionalPosition(int additionalPositionId)
|
||||
{
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
@@ -228,7 +282,7 @@ namespace Swarmops.Database
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return ReadRefundFromDataReader(reader);
|
||||
return ReadAdditionalPositionFromDataReader(reader);
|
||||
}
|
||||
|
||||
throw new ArgumentException("No such StandardPositionId:" + additionalPositionId);
|
||||
@@ -237,9 +291,9 @@ namespace Swarmops.Database
|
||||
}
|
||||
|
||||
|
||||
public BasicRefund[] GetAdditionalPositions(params object[] conditions)
|
||||
public BasicPosition[] GetAdditionalPositions(params object[] conditions)
|
||||
{
|
||||
List<BasicRefund> result = new List<BasicRefund>();
|
||||
List<BasicPosition> result = new List<BasicPosition>();
|
||||
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
@@ -247,13 +301,13 @@ namespace Swarmops.Database
|
||||
|
||||
DbCommand command =
|
||||
GetDbCommand(
|
||||
"SELECT" + standardPositionFieldSequence + ConstructWhereClause("PositionsAdditional", conditions), connection);
|
||||
"SELECT" + additionalPositionFieldSequence + ConstructWhereClause("PositionsAdditional", conditions), connection);
|
||||
|
||||
using (DbDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(ReadRefundFromDataReader(reader));
|
||||
result.Add(ReadAdditionalPositionFromDataReader(reader));
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
@@ -266,7 +320,7 @@ namespace Swarmops.Database
|
||||
|
||||
#region Position Assignments
|
||||
|
||||
public BasicRefund GetPositionAssignment(int positionAssignmentId)
|
||||
public BasicPositionAssignment GetPositionAssignment(int positionAssignmentId)
|
||||
{
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
@@ -281,7 +335,7 @@ namespace Swarmops.Database
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return ReadRefundFromDataReader(reader);
|
||||
return ReadPositionAssignmentFromDataReader(reader);
|
||||
}
|
||||
|
||||
throw new ArgumentException("No such PositionAssignmentId:" + positionAssignmentId);
|
||||
@@ -290,9 +344,9 @@ namespace Swarmops.Database
|
||||
}
|
||||
|
||||
|
||||
public BasicRefund[] GetPositionAssignments(params object[] conditions)
|
||||
public BasicPositionAssignment[] GetPositionAssignments(params object[] conditions)
|
||||
{
|
||||
List<BasicRefund> result = new List<BasicRefund>();
|
||||
List<BasicPositionAssignment> result = new List<BasicPositionAssignment>();
|
||||
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
@@ -306,7 +360,7 @@ namespace Swarmops.Database
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(ReadRefundFromDataReader(reader));
|
||||
result.Add(ReadPositionAssignmentFromDataReader(reader));
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
@@ -320,6 +374,15 @@ namespace Swarmops.Database
|
||||
#endregion
|
||||
|
||||
#region Creation and manipulation -- stored procedures
|
||||
|
||||
|
||||
public int CreateStandardPosition (int organizationId, int positionLevel, string positionType,
|
||||
bool volunteerable, bool overridable, int reportsToPositionId, int dotReportsToPositionId, int minCount,
|
||||
int maxCount)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
public int CreateRefund(int paymentId, int createdByPersonId)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
</configSections>
|
||||
<startup>
|
||||
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
|
||||
<applicationSettings>
|
||||
<Activizr.Database.DatabaseConnect>
|
||||
<setting name="Read" serializeAs="String">
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic", "Logic\Logic.csproj", "{13E59551-34AC-43DC-9A03-EF5E4721DC61}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D} = {BBF83512-8486-469E-9D7B-C3C1B78C3F4D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interface", "Interface\Interface.csproj", "{BA24FAF7-D518-49E8-952A-45595682877E}"
|
||||
EndProject
|
||||
@@ -9,8 +12,14 @@ EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utility", "Utility\Utility.csproj", "{C540570C-20E0-4979-84EB-8833810DDDF6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database", "Database\Database.csproj", "{3A5B5F19-51A5-48CE-A82E-97D5C189E5CB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D} = {BBF83512-8486-469E-9D7B-C3C1B78C3F4D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Basic", "Basic\Basic.csproj", "{6608C2E6-F841-4CD1-8AB2-28DC3B1DDDD1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D} = {BBF83512-8486-469E-9D7B-C3C1B78C3F4D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backend", "Backend\Backend.csproj", "{B7C7320D-A721-4EA8-83E9-1B09AAFF20E9}"
|
||||
EndProject
|
||||
@@ -37,12 +46,19 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Site5", "Site5\", "{367F36E
|
||||
DefaultWebSiteLanguage = "Visual C#"
|
||||
EndProjectSection
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D} = {BBF83512-8486-469E-9D7B-C3C1B78C3F4D}
|
||||
{3A5B5F19-51A5-48CE-A82E-97D5C189E5CB} = {3A5B5F19-51A5-48CE-A82E-97D5C189E5CB}
|
||||
{13E59551-34AC-43DC-9A03-EF5E4721DC61} = {13E59551-34AC-43DC-9A03-EF5E4721DC61}
|
||||
{BA24FAF7-D518-49E8-952A-45595682877E} = {BA24FAF7-D518-49E8-952A-45595682877E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{011D2EFB-77AB-4A13-A753-85C2E56C961D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D} = {BBF83512-8486-469E-9D7B-C3C1B78C3F4D}
|
||||
{13E59551-34AC-43DC-9A03-EF5E4721DC61} = {13E59551-34AC-43DC-9A03-EF5E4721DC61}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -189,6 +205,21 @@ Global
|
||||
{011D2EFB-77AB-4A13-A753-85C2E56C961D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{011D2EFB-77AB-4A13-A753-85C2E56C961D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{011D2EFB-77AB-4A13-A753-85C2E56C961D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Autobuild|.NET.ActiveCfg = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Autobuild|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Autobuild|Any CPU.Build.0 = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Autobuild|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Autobuild|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Debug|.NET.ActiveCfg = Debug|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Release|.NET.ActiveCfg = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{BBF83512-8486-469E-9D7B-C3C1B78C3F4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user