diff --git a/Basic/Config.cs b/Basic/Config.cs index ea1a4ff2..5b35e4e0 100644 --- a/Basic/Config.cs +++ b/Basic/Config.cs @@ -1,7 +1,5 @@ using System; using System.Configuration; -using System.Collections.Generic; -using System.Text; namespace Swarmops.Basic { @@ -11,7 +9,7 @@ namespace Swarmops.Basic { get { - string portString = ConfigurationSettings.AppSettings["SmtpPort"]; + string portString = ConfigurationManager.AppSettings["SmtpPort"]; if (String.IsNullOrEmpty(portString)) { @@ -26,7 +24,7 @@ namespace Swarmops.Basic { get { - string smtpHost = ConfigurationSettings.AppSettings["SmtpHost"]; + string smtpHost = ConfigurationManager.AppSettings["SmtpHost"]; if (String.IsNullOrEmpty(smtpHost)) { diff --git a/Database/Configuration.cs b/Database/Configuration.cs index 35fa53dc..cb75534c 100644 --- a/Database/Configuration.cs +++ b/Database/Configuration.cs @@ -131,7 +131,8 @@ namespace Swarmops.Database // Dev console process - return "database.config"; // Each dev needs to set the working directory to the Console directory when debugging + // Each dev needs to set the working directory to the Console directory when debugging + // return "database.config"; } } } diff --git a/Logic/Communications/PhoneMessageTransmitter.cs b/Logic/Communications/PhoneMessageTransmitter.cs index 595be68a..e37eb3fb 100644 --- a/Logic/Communications/PhoneMessageTransmitter.cs +++ b/Logic/Communications/PhoneMessageTransmitter.cs @@ -246,8 +246,10 @@ namespace Swarmops.Logic.Communications // buffer för inläsning var buf = new byte[8092]; +#pragma warning disable 618 // ServicePointManager.CertificatePolicy is obsoleted, but is the only thing that works on both windows and mono. //Needed to avoid errors from homegrown SSL cert. + ICertificatePolicy oldPolicy = ServicePointManager.CertificatePolicy; ServicePointManager.CertificatePolicy = new HTTPSender(); @@ -263,6 +265,7 @@ namespace Swarmops.Logic.Communications var response = (HttpWebResponse)request.GetResponse(); responseOut = response; ServicePointManager.CertificatePolicy = oldPolicy; +#pragma warning restore 618 // läs in dataströmmen via responsmetoden Stream resStream = response.GetResponseStream(); diff --git a/Logic/Financial/FinancialAccount.cs b/Logic/Financial/FinancialAccount.cs index 52d77dde..85a340c0 100644 --- a/Logic/Financial/FinancialAccount.cs +++ b/Logic/Financial/FinancialAccount.cs @@ -80,7 +80,7 @@ namespace Swarmops.Logic.Financial public Int64 GetBudgetCents (int year) { - return (Int64) (GetBudget(year)*100); + return (Int64) (SwarmDb.GetDatabaseForReading().GetFinancialAccountBudget(this.Identity, year)*100); } public Int64[] GetBudgetMonthly (int year) diff --git a/Logic/Financial/Payout.cs b/Logic/Financial/Payout.cs index dbdfdf93..910301d6 100644 --- a/Logic/Financial/Payout.cs +++ b/Logic/Financial/Payout.cs @@ -35,7 +35,7 @@ namespace Swarmops.Logic.Financial // TODO: Create in database - return payout; + // return payout; } private Payout (BasicPayout basic): diff --git a/Logic/Security/BCrypt.cs b/Logic/Security/BCrypt.cs index 94cb9981..6761f4d9 100644 --- a/Logic/Security/BCrypt.cs +++ b/Logic/Security/BCrypt.cs @@ -21,8 +21,6 @@ namespace Swarmops.Logic.Security // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - [assembly: System.Reflection.AssemblyVersion("0.1")] - /// BCrypt implements OpenBSD-style Blowfish password hashing /// using the scheme described in "A Future-Adaptable Password Scheme" /// by Niels Provos and David Mazieres. diff --git a/Logic/Special/Sweden/SwedishForumDatabase.cs b/Logic/Special/Sweden/SwedishForumDatabase.cs index 925cca97..75076a96 100644 --- a/Logic/Special/Sweden/SwedishForumDatabase.cs +++ b/Logic/Special/Sweden/SwedishForumDatabase.cs @@ -1019,7 +1019,11 @@ namespace Swarmops.Logic.Special.Sweden try { +#pragma warning disable 618 + // ServicePointManager.CertificatePolicy is obsoleted, but is the only thing that works on both windows and mono. + //Needed to avoid errors from homegrown SSL cert. ServicePointManager.CertificatePolicy = new ErrorIgnorerPolicy(); +#pragma warning restore 618 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); //string proxy = null; Encoding recieverEncoding = Encoding.GetEncoding("iso-8859-1"); diff --git a/Logic/Swarm/OfficerChain.cs b/Logic/Swarm/OfficerChain.cs index 0a0747ec..84471158 100644 --- a/Logic/Swarm/OfficerChain.cs +++ b/Logic/Swarm/OfficerChain.cs @@ -11,7 +11,7 @@ namespace Swarmops.Logic.Swarm } - public static OfficerChain FromOrganizationAndGeography (Organization org, Geography geo) + public new static OfficerChain FromOrganizationAndGeography (Organization org, Geography geo) { int[] concernedPeopleId = Roles.GetAllUpwardRoles(org.Identity, geo.Identity); People concernedPeople = People.FromIdentities(concernedPeopleId); diff --git a/Site5/Automation/UploadFileHandler.ashx b/Site5/Automation/UploadFileHandler.ashx index 9c64497a..8c50f00b 100644 --- a/Site5/Automation/UploadFileHandler.ashx +++ b/Site5/Automation/UploadFileHandler.ashx @@ -133,20 +133,20 @@ namespace Swarmops.Frontend.Automation throw new NotImplementedException ( "We should never get to partial upload. If we do, something is very very unexpected and this needs to be implemented."); - using (var fs = new FileStream (fullName, FileMode.Append, FileAccess.Write)) - { - var buffer = new byte[1024]; + //using (var fs = new FileStream(fullName, FileMode.Append, FileAccess.Write)) + //{ + // var buffer = new byte[1024]; - int l = inputStream.Read (buffer, 0, 1024); - while (l > 0) - { - fs.Write (buffer, 0, l); - l = inputStream.Read (buffer, 0, 1024); - } - fs.Flush(); - fs.Close(); - } - statuses.Add (new FilesStatus (new FileInfo (fullName))); + // int l = inputStream.Read(buffer, 0, 1024); + // while (l > 0) + // { + // fs.Write(buffer, 0, l); + // l = inputStream.Read(buffer, 0, 1024); + // } + // fs.Flush(); + // fs.Close(); + //} + //statuses.Add(new FilesStatus(new FileInfo(fullName))); } // Upload entire file diff --git a/Site5/Pages/v5/Ledgers/CloseLedgers.aspx.cs b/Site5/Pages/v5/Ledgers/CloseLedgers.aspx.cs index 2440eece..23bb7c08 100644 --- a/Site5/Pages/v5/Ledgers/CloseLedgers.aspx.cs +++ b/Site5/Pages/v5/Ledgers/CloseLedgers.aspx.cs @@ -55,43 +55,43 @@ public partial class Pages_v5_Ledgers_CloseLedgers : PageV5Base // First, roll over virtual balances. - if (false) // if this.CurrentOrganization.Parameters.VirtualBankingEnabled - { - FinancialAccount rootAccount = FinancialAccount.FromIdentity(29); // HACK: Hardcoded account; should be _organization.FinancialAccount.CostsVirtualBankingRoot - FinancialAccount tempAccount = FinancialAccount.FromIdentity(98); // HACK: Hardcoded account; should be _organization.FinancialAccount.AssetsVirtualRollover + //if (false) // if this.CurrentOrganization.Parameters.VirtualBankingEnabled + //{ + // FinancialAccount rootAccount = FinancialAccount.FromIdentity(29); // HACK: Hardcoded account; should be _organization.FinancialAccount.CostsVirtualBankingRoot + // FinancialAccount tempAccount = FinancialAccount.FromIdentity(98); // HACK: Hardcoded account; should be _organization.FinancialAccount.AssetsVirtualRollover - FinancialAccounts localAccounts = rootAccount.GetTree(); + // FinancialAccounts localAccounts = rootAccount.GetTree(); - foreach (FinancialAccount account in localAccounts) - { - Int64 currentBalanceCents = account.GetDeltaCents(new DateTime(closingYear, 1, 1), new DateTime(closingYear+1, 1, 1)); - Int64 budgetCents = -account.GetBudgetCents(closingYear); - Int64 carryOverCents = budgetCents - currentBalanceCents; + // foreach (FinancialAccount account in localAccounts) + // { + // Int64 currentBalanceCents = account.GetDeltaCents(new DateTime(closingYear, 1, 1), new DateTime(closingYear+1, 1, 1)); + // Int64 budgetCents = -account.GetBudgetCents(closingYear); + // Int64 carryOverCents = budgetCents - currentBalanceCents; - if (carryOverCents != 0) - { - FinancialTransaction transactionOldYear = FinancialTransaction.Create(1, - new DateTime(closingYear, 12, - 31, 23, 50, - 00), - "Budgetrest " + account.Name); - // HACK: Localize rollover label + // if (carryOverCents != 0) + // { + // FinancialTransaction transactionOldYear = FinancialTransaction.Create(1, + // new DateTime(closingYear, 12, + // 31, 23, 50, + // 00), + // "Budgetrest " + account.Name); + // // HACK: Localize rollover label - transactionOldYear.AddRow(account, carryOverCents, null); - transactionOldYear.AddRow(tempAccount, -carryOverCents, null); + // transactionOldYear.AddRow(account, carryOverCents, null); + // transactionOldYear.AddRow(tempAccount, -carryOverCents, null); - FinancialTransaction transactionNewYear = FinancialTransaction.Create(1, - new DateTime(closingYear + 1, - 1, 1, 0, 10, 0), - "Budgetrest " + - closingYear.ToString() + " " + - account.Name); + // FinancialTransaction transactionNewYear = FinancialTransaction.Create(1, + // new DateTime(closingYear + 1, + // 1, 1, 0, 10, 0), + // "Budgetrest " + + // closingYear.ToString() + " " + + // account.Name); - transactionNewYear.AddRow(account, -carryOverCents, null); - transactionNewYear.AddRow(tempAccount, carryOverCents, null); - } - } - } + // transactionNewYear.AddRow(account, -carryOverCents, null); + // transactionNewYear.AddRow(tempAccount, carryOverCents, null); + // } + // } + //} // Then, actually close the ledgers.