Exemplo n.º 1
0
        public bool CreateTransaction(Transaction transaction)
        {
            var b = GetTransaction(transaction.TransId);

            if (b == null)
            {
                _dbContext.Transactions.Add(transaction);
                _dbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public bool CreateCard(Card card)
        {
            var b = GetCard(card.CardId);

            if (b == null)
            {
                _dbContext.Cards.Add(card);
                _dbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        public bool CreatePayment(PaymentInfo payment)
        {
            var b = GetPayment(payment.PayId);

            if (b == null)
            {
                _dbContext.PaymentInfos.Add(payment);
                _dbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
 public bool CreateCategory(Category category)
 {
     try
     {
         _dbContext.Categories.Add(category);
         _dbContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 5
0
 public bool CreateFeedback(Feedback feedback)
 {
     try
     {
         _dbContext.Feedbacks.Add(feedback);
         _dbContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 6
0
 public bool CreateUser(UserViewModel userView)
 {
     try
     {
         var user = new User
         {
             UserName = userView.UserName,
             Password = userView.Password,
             FullName = userView.FullName,
             Gender   = userView.Gender,
             Phone    = userView.Phone,
             Email    = userView.Email
         };
         _dbContext.Add(user);
         _dbContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 7
0
 public void SaveChanges()
 {
     DbContext.SaveChanges();
 }