// GET: Provider public ActionResult Index() { ProviderDBHandle dbhandle = new ProviderDBHandle(); ModelState.Clear(); return(View(dbhandle.Get())); }
public ActionResult Create(PaymentRecordModel smodel) { ProviderDBHandle pdbh = new ProviderDBHandle(); ViewBag.providerList = pdbh.Get(); ExpenseCategoryDBHandle exdbh = new ExpenseCategoryDBHandle(); ViewBag.categoryList = exdbh.Get(); RecurenceTypeDBHandle rtdbh = new RecurenceTypeDBHandle(); ViewBag.resourceTypeList = rtdbh.Get(); try { if (ModelState.IsValid) { PaymentRecordDBHandle sdb = new PaymentRecordDBHandle(); if (sdb.Add(smodel)) { ViewBag.Message = "Details Added Successfully"; ModelState.Clear(); } } return(View()); } catch (Exception e) { e.GetBaseException(); return(View()); } }
public ActionResult Edit(int id, ProviderModel smodel) { try { ProviderDBHandle sdb = new ProviderDBHandle(); sdb.UpdateDetails(smodel); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Provider/Delete/5 public ActionResult Delete(int id) { try { ProviderDBHandle sdb = new ProviderDBHandle(); if (sdb.Delete(id)) { ViewBag.AlertMsg = "Deleted Successfully"; } return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: PaymentRecord/Create public ActionResult Create() { ProviderDBHandle pdbh = new ProviderDBHandle(); ViewBag.providerList = pdbh.Get(); ExpenseCategoryDBHandle exdbh = new ExpenseCategoryDBHandle(); ViewBag.categoryList = exdbh.Get(); RecurenceTypeDBHandle rtdbh = new RecurenceTypeDBHandle(); ViewBag.resourceTypeList = rtdbh.Get(); return(View()); }
// GET: PaymentRecord/Edit/5 public ActionResult Edit(int id) { ProviderDBHandle pdbh = new ProviderDBHandle(); ViewBag.providerList = pdbh.Get(); ExpenseCategoryDBHandle exdbh = new ExpenseCategoryDBHandle(); ViewBag.categoryList = exdbh.Get(); RecurenceTypeDBHandle rtdbh = new RecurenceTypeDBHandle(); ViewBag.resourceTypeList = rtdbh.Get(); PaymentRecordDBHandle sdb = new PaymentRecordDBHandle(); return(View(sdb.Get().Find(smodel => smodel.id == id))); }
public ActionResult Create(ProviderModel smodel) { try { if (ModelState.IsValid) { ProviderDBHandle sdb = new ProviderDBHandle(); if (sdb.Add(smodel)) { ViewBag.Message = "Details Added Successfully"; ModelState.Clear(); } } return(View()); } catch (Exception e) { e.GetBaseException(); return(View()); } }
public ActionResult Edit(int id, PaymentRecordModel smodel) { ProviderDBHandle pdbh = new ProviderDBHandle(); ViewBag.providerList = pdbh.Get(); ExpenseCategoryDBHandle exdbh = new ExpenseCategoryDBHandle(); ViewBag.categoryList = exdbh.Get(); RecurenceTypeDBHandle rtdbh = new RecurenceTypeDBHandle(); ViewBag.resourceTypeList = rtdbh.Get(); try { PaymentRecordDBHandle sdb = new PaymentRecordDBHandle(); sdb.UpdateDetails(smodel); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Provider/Edit/5 public ActionResult Edit(int id) { ProviderDBHandle sdb = new ProviderDBHandle(); return(View(sdb.Get().Find(smodel => smodel.id == id))); }