// GET: public ActionResult AccountCreate() { GetAccounts g = new GetAccounts(); SelectList s = g.AccountPersonSelectList("Mike"); ViewBag.accountpersons = s; SelectList s2 = g.AccountTypesSelectList("Expenses"); ViewBag.accounttypes = s2; return(View()); }
// GET: public ActionResult AccountEdit(string id) { var collection = context.db.GetCollection <Account>("Accounts"); Account account = collection.Find(x => x.Id == ObjectId.Parse(id)).FirstOrDefault(); GetAccounts g = new GetAccounts(); SelectList s = g.AccountPersonSelectList(account.AccountPerson.AccountPerson1); ViewBag.accountpersons = s; SelectList s2 = g.AccountTypesSelectList(account.AccountSubType.AccountType.AccountType1); ViewBag.accounttypes = s2; return(View(account)); }