コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public TypeOfOutgoing AddTypeOfOutgoing(TypeOfOutgoing typeOfOutgoing)
        {
            TypeOfOutgoing tempTypeOfAmount;

            try
            {
                tempTypeOfAmount = _financeManagerContext.TypeOfOutgoings.Add(typeOfOutgoing);
                _financeManagerContext.SaveChanges();
            }
            catch (Exception ex)
            {
                tempTypeOfAmount = null;
            }
            return(tempTypeOfAmount);
        }
コード例 #4
0
        public SourceOfAmount AddSourceOfAmount(SourceOfAmount sourceOfAmount)
        {
            SourceOfAmount tempSourceOfAmount;

            try
            {
                tempSourceOfAmount = _financeManagerContext.SourceOfAmounts.Add(sourceOfAmount);
                _financeManagerContext.SaveChanges();
            }
            catch (Exception ex)
            {
                tempSourceOfAmount = null;
            }
            return(tempSourceOfAmount);
        }