Example #1
0
        // GET: Warrant/Delete/5
        public ActionResult Delete(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Db      db      = new Db(DbServices.ConnectionString);
            Warrant warrant = WarrantServices.Get(id.Value, db);

            if (warrant == null)
            {
                return(HttpNotFound());
            }
            return(View(warrant));
        }
Example #2
0
        // GET: Warrant/Edit/5
        public ActionResult Edit(Nullable <int> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Warrant warrant = WarrantServices.Get(id.Value, db);

            if (warrant == null)
            {
                return(HttpNotFound());
            }

            ViewBag.DebtList     = new SelectList(DebtServices.List(db), "Id", "ReferenceNumber", warrant.Debt);
            ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "FirstName", warrant.Employee);
            return(View(warrant));
        }