public bool RemoveOutGoing(long id, string userId) { bool success; try { _financeManagerContext.Outgoings.Remove(GetOutGoing(id, userId)); _financeManagerContext.SaveChanges(); success = true; } catch (Exception ex) { success = false; } return(success); }
public bool RemoveIncome(long?id) { bool success; try { _financeManagerContext.Incomes.Remove(_financeManagerContext.Incomes.SingleOrDefault(x => x.Id == id)); _financeManagerContext.SaveChanges(); success = true; } catch (Exception ex) { success = false; } return(success); }
public TypeOfOutgoing AddTypeOfOutgoing(TypeOfOutgoing typeOfOutgoing) { TypeOfOutgoing tempTypeOfAmount; try { tempTypeOfAmount = _financeManagerContext.TypeOfOutgoings.Add(typeOfOutgoing); _financeManagerContext.SaveChanges(); } catch (Exception ex) { tempTypeOfAmount = null; } return(tempTypeOfAmount); }
public SourceOfAmount AddSourceOfAmount(SourceOfAmount sourceOfAmount) { SourceOfAmount tempSourceOfAmount; try { tempSourceOfAmount = _financeManagerContext.SourceOfAmounts.Add(sourceOfAmount); _financeManagerContext.SaveChanges(); } catch (Exception ex) { tempSourceOfAmount = null; } return(tempSourceOfAmount); }