public async Task <UnitOfMeasure> AddUnitOfMeasureAsync(UnitOfMeasure unitOfMeasure) { _context.Create(unitOfMeasure); await _context.CommitAsync(); return(unitOfMeasure); }
public async Task <StockType> AddStockTypeAsync(StockType stockType) { _context.Create(stockType); await _context.CommitAsync(); return(stockType); }
public async Task <TransactionType> AddTransactionTypeAsync(TransactionType transactionType) { _context.Create(transactionType); await _context.CommitAsync(); return(transactionType); }
public async Task <ServiceType> AddServiceTypeAsync(ServiceType serviceType) { _context.Create(serviceType); await _context.CommitAsync(); return(serviceType); }
public async Task <PaymentType> AddPaymentTypeAsync(PaymentType paymentType) { _context.Create(paymentType); await _context.CommitAsync(); return(paymentType); }
public async Task <Supplier> AddSupplierAsync(Supplier supplier) { _context.Create(supplier); await _context.CommitAsync(); return(supplier); }
public async Task <StockItem> AddStockItemAsync(StockItem stockItem) { _context.Create(stockItem); await _context.CommitAsync(); return(await _context.StockItems .Include(p => p.Type) .Include(p => p.UnitOfMeasure) .FirstAsync(e => e.Id == stockItem.Id)); }
public async Task <PurchaseOrderItem> AddPurchaseOrderItemAsync(PurchaseOrderItem orderItem) { _context.Create(orderItem); await _context.CommitAsync(); return(await _context.PurchaseOrderItems .Include(p => p.PurchaseOrder) .Include(p => p.Item) .FirstAsync(e => e.Id == orderItem.Id)); }
public async Task <GoodsReceivedNoteItem> AddGoodsReceivedNoteItemAsync(GoodsReceivedNoteItem goodsReceivedNoteItem) { _context.Create(goodsReceivedNoteItem); await _context.CommitAsync(); return(await _context.GoodsReceivedNoteItems .Include(p => p.Item) .Include(p => p.GoodsReceivedNote) .FirstAsync(e => e.Id == goodsReceivedNoteItem.Id)); }
public async Task <Transaction> AddTransactionAsync(Transaction transaction) { _context.Create(transaction); await _context.CommitAsync(); return(await _context.Transactions .Include(p => p.TransactionType) .Include(p => p.PaymentType) .FirstAsync(e => e.Id == transaction.Id)); }
public async Task <PurchaseOrder> AddPurchaseOrderAsync(PurchaseOrder order) { _context.Create(order); await _context.CommitAsync(); return(await _context.PurchaseOrders .Include(p => p.Supplier) .Include(p => p.RequestedUser) .FirstAsync(e => e.Id == order.Id)); }
public async Task <GoodsReceivedNote> AddGoodsReceivedNoteAsync(GoodsReceivedNote goodsReceivedNote) { _context.Create(goodsReceivedNote); await _context.CommitAsync(); return(await _context.GoodsReceivedNotes .Include(p => p.PaymentType) .Include(p => p.PurchaseOrder) .Include(p => p.ReceivedUser) .FirstAsync(e => e.Id == goodsReceivedNote.Id)); }
public async Task <RefreshToken> GenerateRefreshToken(Guid userId, string ipAddress) { var token = GenerateToken(_jwtSettings.RefreshTokenSecret, _jwtSettings.Issuer, _jwtSettings.Audience, _jwtSettings.RefreshTokenExpirationInMinutes, claims: null); var refreshToken = new RefreshToken { Token = token, UserId = userId, Expires = DateTime.UtcNow.AddMinutes(_jwtSettings.RefreshTokenExpirationInMinutes), Created = DateTime.UtcNow, CreatedByIp = ipAddress }; _context.Create(refreshToken); await _context.CommitAsync(); return(refreshToken); }