Ejemplo n.º 1
0
        public IEnumerable<BankAccountsInfo> SetBankAccountID(string name, string number, string type)
        {
            int id = 0;
            string accountname = "";

            var bank = new BankAccountsInfo {  BankAccountName = name,  BankAccountNumber = number,  BankAccountType = type };
            context.BankAccountsInfoes.Add(bank);
               context.SaveChanges();

            id = bank.BankAccountID;
            accountname = bank.BankAccountName;

            //Int32 companyid = Convert.ToInt32(HttpContext.Current.Session["CompanyID"]);
            //Company company = context.Companies.Single(q => q.CompanyID == companyid);
            //company.BankAccount = id;
            //context.SaveChanges();

            return context.BankAccountsInfoes.Where(q => q.BankAccountID == id).ToList();
        }
Ejemplo n.º 2
0
        public int InsertBankAccount(BankAccountsInfo bank)
        {
            try
            {
                context.Entry(bank).State = EntityState.Added;
               context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return bank.BankAccountID;
        }
Ejemplo n.º 3
0
 public void UpdateBankAccount(BankAccountsInfo bank)
 {
     try
     {
         userRepository.UpdateBankAccount(bank);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
 public void UpdateBankAccount(BankAccountsInfo bank)
 {
     try
     {
         //context.Users.Attach(user);
         context.Entry(bank).State = EntityState.Modified;
          context.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
 public int InsertBankAccount(BankAccountsInfo bank)
 {
     return userRepository.InsertBankAccount(bank);
 }