// GET: Holding/Details/5 public async Task <ActionResult> Details(string id) { var holding = await HoldingLib.GetHolding(id.ToString()); if (holding == null) { var errorMsg = string.Format("Holding {0} not found.", id); throw new HttpException(404, errorMsg); } return(View(holding)); }
public async Task <ActionResult> DeleteConfirmed(string id) { try { await HoldingLib.DeleteHolding(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <ActionResult> Edit([Bind(Include = "Id,HoldingId,EmployeeId,FundId,SharesOwned")] Holding holding) { try { await HoldingLib.UpdateHolding(holding); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public async Task <ActionResult> Create([Bind(Include = "Id,HoldingId,EmployeeId,FundId,SharesOwned")] Holding holding) { try { var rand = new Random(); var id = rand.Next().ToString(); holding.Id = id; await HoldingLib.InsertHolding(holding); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
// GET: Holding/Edit/5 public async Task <ActionResult> Edit(string id) { var employeesList = await EmployeerLib.GetAllEmployees(); var fundsList = await FundLib.GetAllFunds(); var holding = await HoldingLib.GetHolding(id.ToString()); if (holding == null) { var errorMsg = string.Format("Holding {0} not found.", id); throw new HttpException(404, errorMsg); } ViewBag.EmployeeId = new SelectList(employeesList, "Id", "FullName", holding.EmployeeId); ViewBag.FundId = new SelectList(fundsList, "Id", "Name", holding.FundId); return(View(holding)); }
// GET Holding/EmployeeHoldings/00001 public async Task <ActionResult> EmployeeHoldings(string id) { var holdings = await HoldingLib.GetHoldingByEmployeeId(id); return(View("Index", holdings)); }
// GET: Holding public async Task <ActionResult> Index() { var holdings = await HoldingLib.GetAllHoldings(); return(View(holdings)); }