public AccountTransactionFile AddAccountTransactionFile(AccountTransactionFileSync file, int tenantId) { var accountTransFile = AutoMapper.Mapper.Map(file, new AccountTransactionFile()); accountTransFile.CreatedBy = file.UserId; accountTransFile.DateCreated = file.CreatedDate ?? DateTime.UtcNow; accountTransFile.IsDeleted = file.IsDeleted; accountTransFile.TenantId = tenantId; _currentDbContext.AccountTransactionFiles.Add(accountTransFile); _currentDbContext.SaveChanges(); return(accountTransFile); }
//http://ganetest.qsrtime.net/api/sync/add-transaction-file public IHttpActionResult AddAccountTransactionFileSync(AccountTransactionFileSync model) { var serialNumber = model.SerialNumber.Trim().ToLower(); var terminal = TerminalServices.GetTerminalBySerial(serialNumber); if (terminal == null) { return(Unauthorized()); } var result = _accountServices.AddAccountTransactionFile(model, terminal.TenantId); return(Ok(result)); }