Added Resolved=true to OutboundComm.CreateNotification
This commit is contained in:
@@ -214,17 +214,33 @@ namespace Swarmops.Database
|
||||
AddParameterWithName(command, "senderPersonId", senderPersonId);
|
||||
AddParameterWithName(command, "fromPersonId", fromPersonId);
|
||||
AddParameterWithName(command, "organizationId", organizationId);
|
||||
AddParameterWithName(command, "resolverClass", String.IsNullOrEmpty(resolverClass)? "0": resolverClass); // Will be turned into ID by stored procedure
|
||||
AddParameterWithName(command, "recipientDataXml", String.IsNullOrEmpty(recipientDataXml)? string.Empty: recipientDataXml);
|
||||
AddParameterWithName(command, "resolverClass", String.IsNullOrEmpty(resolverClass) ? "0" : resolverClass); // Will be turned into ID by stored procedure
|
||||
AddParameterWithName(command, "recipientDataXml", String.IsNullOrEmpty(recipientDataXml) ? string.Empty : recipientDataXml);
|
||||
AddParameterWithName(command, "transmitterClass", transmitterClass); // Will be turned into ID by stored procedure
|
||||
AddParameterWithName(command, "payloadXml", payloadXml);
|
||||
AddParameterWithName(command, "priority", (int) priority); // convert enum to integerized priority; convert back on field read
|
||||
AddParameterWithName(command, "priority", (int)priority); // convert enum to integerized priority; convert back on field read
|
||||
AddParameterWithName(command, "createdDateTime", DateTime.UtcNow);
|
||||
|
||||
return Convert.ToInt32(command.ExecuteScalar());
|
||||
}
|
||||
}
|
||||
|
||||
public void SetOutboundCommResolved(int outboundCommId)
|
||||
{
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
connection.Open();
|
||||
|
||||
DbCommand command = GetDbCommand("SetOutboundCommResolved", connection);
|
||||
command.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
AddParameterWithName(command, "outboundCommId", outboundCommId);
|
||||
AddParameterWithName(command, "dateTime", DateTime.UtcNow);
|
||||
|
||||
command.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -95,6 +95,23 @@ namespace Swarmops.Logic.Communications
|
||||
// public static OutboundComm CreateNotification (FinancialAccount budget, string notificationResource)
|
||||
|
||||
|
||||
public new bool Resolved
|
||||
{
|
||||
get { return base.Resolved; }
|
||||
set
|
||||
{
|
||||
if (!base.Resolved && value == true)
|
||||
{
|
||||
SwarmDb.GetDatabaseForWriting().SetOutboundCommResolved(this.Identity);
|
||||
base.Resolved = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Can only set OutboundComms.Resolved from false to true");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void AddRecipient (Person person)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace Swarmops
|
||||
_authority = _currentUser.GetAuthority();
|
||||
_currentOrganization = Organization.FromIdentity(currentOrganizationId);
|
||||
|
||||
// OutboundComm.CreateNotification(null, NotificationResource.System_Startup);
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user