// GET: SalaryPayment/Delete/5 public ActionResult Delete(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Db db = new Db(DbServices.ConnectionString); SalaryPayment salaryPayment = SalaryPaymentServices.Get(id.Value, db); if (salaryPayment == null) { return(HttpNotFound()); } return(View(salaryPayment)); }
// GET: SalaryPayment/Edit/5 public ActionResult Edit(Nullable <int> payment) { Db db = new Db(DbServices.ConnectionString); if (payment == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SalaryPayment salaryPayment = SalaryPaymentServices.Get(payment.Value, db); if (salaryPayment == null) { return(HttpNotFound()); } ViewBag.PaymentList = new SelectList(PaymentServices.List(db), "Id", "Notes", salaryPayment.Payment); ViewBag.DepartmentList = new SelectList(DepartmentServices.List(db), "Id", "Name", salaryPayment.Department); return(View(salaryPayment)); }