public void DeleteInvesment(Invesment item) { using (var context = new VaultDBContext()) { context.Remove(item); context.SaveChanges(); } }
public List <Invesment> GetInvesmentListByDate(DateTime date) { using (var context = new VaultDBContext()) { var InvesmentList = context.Invesments.Where(x => x.Date.Month == date.Date.Month).ToList(); return(InvesmentList); } }
public List <Invesment> GetInvesmentList() { using (var context = new VaultDBContext()) { var invesmentList = context.Invesments.ToList(); return(invesmentList); } }
public void DeleteExpense(Expense item) { using (var context = new VaultDBContext()) { context.Remove(item); context.SaveChanges(); } }
public void UpdateExpense(Expense item) { using (var context = new VaultDBContext()) { context.Expenses.Update(item); context.SaveChanges(); } }
public List <Expense> GetExpenseListByDate(DateTime date) { using (var context = new VaultDBContext()) { var expenseList = context.Expenses.Where(x => x.Date.Month == date.Date.Month).ToList(); return(expenseList); } }
public void InsertInvesment(InvesmentInsertModel item) { using (var context = new VaultDBContext()) { Invesment Invesment = new() { Amount = item.Amount, Quantity = item.Quantity, Type = item.Type.ToString(), Date = item.Date.Date }; context.Invesments.Add(Invesment); context.SaveChanges(); } }
public void InsertExpense(ExpenseInsertModel item) { using (var context = new VaultDBContext()) { Expense expense = new() { Amount = item.Amount, Description = item.Description, IsCredit = item.IsCredit, IsPaid = false, Date = item.Date.Date }; context.Expenses.Add(expense); context.SaveChanges(); } }