/// <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); }
/// <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); }
/// <summary> /// Update the event with new values to the service /// </summary> /// <returns></returns> public async Task UpdateEvent() { await DeserializerService <Event> .CheckConnectivity(); await eService.UpdateEvent(this); }
/// <summary> /// Update the user in the service /// </summary> /// <returns></returns> public async Task UpdateUser() { await DeserializerService <User> .CheckConnectivity(); await userService.UpdateUser(this); }