Example #1
0
        public static void UpdateBankAccount(BankAccounts bankAccount)
        {
            BankaIslemleriEntities entities = new BankaIslemleriEntities();

            entities.BankAccounts.Where(k => k.Id == bankAccount.Id).FirstOrDefault().Amount = bankAccount.Amount;
            entities.SaveChanges();
        }
Example #2
0
        public static void CreateUser(Users user)
        {
            BankaIslemleriEntities entities = new BankaIslemleriEntities();

            entities.Users.Add(user);
            entities.SaveChanges();
        }
Example #3
0
 public static void InsertBankAccountToUser(BankAccounts bankAccount, int userId)
 {
     if (bankAccount != null)
     {
         BankaIslemleriEntities entities = new BankaIslemleriEntities();
         var user = GetUserById(userId);
         if (user != null)
         {
             entities.Users.Where(k => k.Id == userId).FirstOrDefault().BankAccounts.Add(bankAccount);
             entities.SaveChanges();
         }
     }
 }
Example #4
0
 public static Users GetUserById(int userId)
 {
     if (userId > 0)
     {
         BankaIslemleriEntities entities = new BankaIslemleriEntities();
         var user = entities.Users.Where(k => k.Id == userId).FirstOrDefault();
         return(user);
     }
     else
     {
         return(null);
     }
 }
Example #5
0
        public static void UpdateUser(Users user)
        {
            BankaIslemleriEntities entities = new BankaIslemleriEntities();

            entities.SaveChanges();
        }
Example #6
0
        public static List <Users> GetAllUsers()
        {
            BankaIslemleriEntities entities = new BankaIslemleriEntities();

            return(entities.Users.ToList());
        }