Exemplo n.º 1
0
 public void AddUser(User user)
 {
     using (ContextDBDataContext context = new ContextDBDataContext(_connectionString))
     {
         context.Users.InsertOnSubmit(user);
         context.SubmitChanges();
     }
 }
Exemplo n.º 2
0
 public void AddCredit(Credit credit)
 {
     using (ContextDBDataContext context = new ContextDBDataContext(_connectionString))
     {
         context.Credits.InsertOnSubmit(credit);
         context.SubmitChanges();
     }
 }
Exemplo n.º 3
0
        public List <Debit> AddDebit(Debit debit)
        {
            using (ContextDBDataContext context = new ContextDBDataContext(_connectionString))
            {
                context.Debits.InsertOnSubmit(debit);
                context.SubmitChanges();

                return(GetDebitsByMonthId(debit.UserId, debit.MonthId));
            }
        }
Exemplo n.º 4
0
        // adds new month and returns false if month already exists
        public bool AddMonth(Month_Year NewMonth)
        {
            using (ContextDBDataContext context = new ContextDBDataContext(_connectionString))
            {
                if (DoesMonthExistForUser(context.Month_Years.Where(M => M.UserId == NewMonth.UserId).ToList(), NewMonth))
                {
                    return(true);
                }

                context.Month_Years.InsertOnSubmit(NewMonth);
                context.SubmitChanges();

                return(false);
            }
        }