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(); }
public int InsertBankAccount(BankAccountsInfo bank) { try { context.Entry(bank).State = EntityState.Added; context.SaveChanges(); } catch (Exception ex) { throw ex; } return bank.BankAccountID; }
public void UpdateBankAccount(BankAccountsInfo bank) { try { userRepository.UpdateBankAccount(bank); } catch (Exception ex) { throw ex; } }
public void UpdateBankAccount(BankAccountsInfo bank) { try { //context.Users.Attach(user); context.Entry(bank).State = EntityState.Modified; context.SaveChanges(); } catch (Exception ex) { throw ex; } }
public int InsertBankAccount(BankAccountsInfo bank) { return userRepository.InsertBankAccount(bank); }