示例#1
0
        public void CreateEvent(ExpenseEventType eventType, int personId)
        {
            // OBSOLETE

            // SwarmDb.GetDatabaseForWriting().CreateExpenseEvent (Identity, eventType, personId);

            // TODO: Repopulate Events property, when created
        }
示例#2
0
        internal static void ProcessExpenseChanged(BasicEvent newEvent)
        {
            Person           expenser     = Person.FromIdentity(newEvent.VictimPersonId);
            Organization     organization = Organization.FromIdentity(newEvent.OrganizationId);
            Geography        geography    = Geography.FromIdentity(newEvent.GeographyId);
            Expense          expense      = Expense.FromIdentity(newEvent.ParameterInt);
            ExpenseEventType eventType    = (ExpenseEventType)Enum.Parse(typeof(ExpenseEventType), newEvent.ParameterText);

            // HACK: This assumes eventType is ExpenseEventType.Approved.

            string body =
                "Receipts for an expense has been received by the treasurer and will be repaid shortly, typically in 5-10 days.\r\n\r\n" +
                "Expense #:     " + expense.Identity.ToString() + "\r\n" +
                "Expense Date:  " + expense.ExpenseDate.ToLongDateString() + "\r\n" +
                "Description:   " + expense.Description + "\r\n" +
                "Amount:        " + expense.Amount.ToString("#,##0.00") + "\r\n\r\n";

            new PirateWeb.Utility.Mail.MailTransmitter("PirateWeb", "*****@*****.**",
                                                       "Expense Approved: " + expense.Description + ", " + expense.Amount.ToString("#,##0.00"),
                                                       body, expense.Claimer, true).Send();
        }
示例#3
0
        public int CreateExpenseEvent(int expenseId, ExpenseEventType eventType, int personId)
        {
            throw new NotImplementedException("Not migrated to version 4");

            /*
             * // WARNING: NOT CONVERTED TO V4 YET
             *
             * using (DbConnection connection = GetSqlServerDbConnection())
             * {
             *  connection.Open();
             *
             *  DbCommand command = GetDbCommand("CreateExpenseEvent", connection);
             *  command.CommandType = CommandType.StoredProcedure;
             *
             *  AddParameterWithName(command, "expenseId", expenseId);
             *  AddParameterWithName(command, "dateTime", DateTime.Now);
             *  AddParameterWithName(command, "eventPersonId", personId);
             *  AddParameterWithName(command, "eventType", eventType.ToString());
             *
             *  return Convert.ToInt32(command.ExecuteScalar());
             * }*/
        }
示例#4
0
        public void CreateEvent(ExpenseEventType eventType, Person person)
        {
            // OBSOLETE

            // CreateEvent (eventType, person.Identity);
        }
示例#5
0
        public void CreateEvent (ExpenseEventType eventType, int personId)
        {
            // OBSOLETE

            // SwarmDb.GetDatabaseForWriting().CreateExpenseEvent (Identity, eventType, personId);

            // TODO: Repopulate Events property, when created
        }
示例#6
0
        public void CreateEvent (ExpenseEventType eventType, Person person)
        {
            // OBSOLETE

            // CreateEvent (eventType, person.Identity);
        }
示例#7
0
        public int CreateExpenseEvent(int expenseId, ExpenseEventType eventType, int personId)
        {
            throw new NotImplementedException("Not migrated to version 4");

            /*
            // WARNING: NOT CONVERTED TO V4 YET

            using (DbConnection connection = GetSqlServerDbConnection())
            {
                connection.Open();

                DbCommand command = GetDbCommand("CreateExpenseEvent", connection);
                command.CommandType = CommandType.StoredProcedure;

                AddParameterWithName(command, "expenseId", expenseId);
                AddParameterWithName(command, "dateTime", DateTime.Now);
                AddParameterWithName(command, "eventPersonId", personId);
                AddParameterWithName(command, "eventType", eventType.ToString());

                return Convert.ToInt32(command.ExecuteScalar());
            }*/
        }