예제 #1
0
        /// <summary>
        /// Send a new action record to the service, added in data
        /// </summary>
        /// <param name="description"></param>
        /// <returns></returns>

        public static async Task AddActionRecord(string description)
        {
            await DeserializerService <ActionRecord> .CheckConnectivity();

            ActionRecord newAction = new ActionRecord()
            {
                UserId          = User.CurrentUser.UserId,
                RecordDate      = DateTime.Today,
                Description     = description,
                PurchaseRecords = null,
                TransferRecords = null
            };

            await aService.AddActionRecord(newAction);
        }
예제 #2
0
        /// <summary>
        /// Add a transfer record with a fixed model
        /// </summary>
        /// <param name="moneyTransfered"></param>
        /// <returns></returns>
        public static async Task AddTransferRecord(double moneyTransfered)
        {
            await DeserializerService <Event> .CheckConnectivity();

            ActionRecord aRecord = new ActionRecord()
            {
                RecordDate      = DateTime.Today,
                UserId          = User.CurrentUser.UserId,
                PurchaseRecords = null,
            };
            TransferRecord newRecord = new TransferRecord()
            {
                TransferedValue = moneyTransfered,
                ActionRecord    = aRecord
            };

            aRecord.Description = (moneyTransfered > 0) ? "Money deposit: " : "Money Withdraw: ";
            await tService.AddTransferRecord(newRecord);
        }