public ActionResult DeleteConfirmed(int id)
        {
            UserTill tillToUser = db.TillUsers.Find(id);

            db.TillUsers.Remove(tillToUser);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Create([Bind(Include = "ID,UserId,GlAccountID")] UserTill tillToUser)
 {
     if (ModelState.IsValid)
     {
         db.TillUsers.Add(tillToUser);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewData["Users"]       = new SelectList(tellerMgtLogic.ExtractTellersWithoutTill(), "Id", "UserName", tillToUser.UserId);
     ViewData["GlAccountID"] = new SelectList(tellerMgtLogic.ExtractTillsWithoutTeller(), "ID", "AccountName", tillToUser.GlAccountID);
     return(View(tillToUser));
 }
 public ActionResult Edit([Bind(Include = "ID,UserId,GlAccountID")] UserTill tillToUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tillToUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //ViewBag.Users = new SelectList(UserManager.Users, "Id", "UserName", tillToUser.UserId);
     ViewBag.GlAccountID = new SelectList(db.GlAccounts, "ID", "AccountName", tillToUser.GlAccountID);
     return(View(tillToUser));
 }
        // GET: TellerManagement/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserTill tillToUser = db.TillUsers.Find(id);

            if (tillToUser == null)
            {
                return(HttpNotFound());
            }
            //ViewBag.Users = new SelectList(UserManager.Users, "Id", "UserName", tillToUser.UserId);
            ViewBag.GlAccountID = new SelectList(db.GlAccounts, "ID", "AccountName", tillToUser.GlAccountID);
            return(View(tillToUser));
        }
        // GET: TellerManagement/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserTill tillToUser = db.TillUsers.Find(id);

            if (tillToUser == null)
            {
                return(HttpNotFound());
            }
            TillToUserViewModel model = new TillToUserViewModel {
                GLAccountName = tillToUser.GlAccount.AccountName, AccountBalance = tillToUser.GlAccount.AccountBalance.ToString(), Username = db.Users.Find(tillToUser.UserId).UserName
            };

            return(View(model));
        }