public ActionResult DeleteConfirmed(int id) { StorePayment storePayment = db.StorePayments.Find(id); db.StorePayments.Remove(storePayment); db.SaveChanges(); return(RedirectToAction("Index", new { id = storePayment.StoreDetailId })); }
public ActionResult DeleteConfirmed(int id) { StorePayment storePayment = store.AdminMgr.GetStorePayment((int)id); if (store.AdminMgr.RemoveStorePayment(storePayment)) { return(RedirectToAction("Index")); } return(View(storePayment)); }
public bool RemoveStorePayment(StorePayment storePayment) { try { return(adminDb.RemoveStorePayment(storePayment)); } catch { return(false); } }
public bool EditStorePayment(StorePayment storePayment) { try { return(adminDb.EditStorePayment(storePayment)); } catch { return(false); } }
public ActionResult Edit([Bind(Include = "Id,StoreDetailId,dtPayment,Amount,StorePaymentTypeId,Remarks,dtPosted,StorePaymentStatusId")] StorePayment storePayment) { if (ModelState.IsValid) { db.Entry(storePayment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { id = storePayment.StoreDetailId })); } ViewBag.StoreDetailId = new SelectList(db.StoreDetails, "Id", "LoginId", storePayment.StoreDetailId); ViewBag.StorePaymentStatusId = new SelectList(db.StorePaymentStatus, "Id", "Name", storePayment.StorePaymentStatusId); ViewBag.StorePaymentTypeId = new SelectList(db.StorePaymentTypes, "Id", "Description", storePayment.StorePaymentTypeId); return(View(storePayment)); }
public bool RemoveStorePayment(StorePayment storePayment) { try { db.StorePayments.Remove(storePayment); db.SaveChanges(); return(true); } catch { return(false); } }
public bool EditStorePayment(StorePayment storePayment) { try { db.Entry(storePayment).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public bool AddStorePayment(StorePayment storePayment) { try { db.StorePayments.Add(storePayment); db.SaveChanges(); return(true); } catch { return(false); } }
public ActionResult Edit([Bind(Include = "Id,StoreDetailId,dtPayment,Amount,StorePaymentTypeId,Remarks,dtPosted,StorePaymentStatusId")] StorePayment storePayment) { if (ModelState.IsValid) { if (store.AdminMgr.EditStorePayment(storePayment)) { return(RedirectToAction("Index")); } } ViewBag.StoreDetailId = new SelectList(store.RefDbLayer.GetStoreDetails(), "Id", "Name", storePayment.StoreDetailId); ViewBag.StorePaymentStatusId = new SelectList(store.RefDbLayer.GetStorePaymentStatus(), "Id", "Name", storePayment.StorePaymentStatusId); ViewBag.StorePaymentTypeId = new SelectList(store.RefDbLayer.GetStorePaymentTypes(), "Id", "Description", storePayment.StorePaymentTypeId); return(View(storePayment)); }
// GET: Admin/StorePayments/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StorePayment storePayment = store.AdminMgr.GetStorePayment((int)id); if (storePayment == null) { return(HttpNotFound()); } return(View(storePayment)); }
// GET: Store/StorePayments/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StorePayment storePayment = db.StorePayments.Find(id); if (storePayment == null) { return(HttpNotFound()); } return(View(storePayment)); }
public ActionResult Create([Bind(Include = "Id,StoreDetailId,dtPayment,Amount,StorePaymentTypeId,Remarks,dtPosted,StorePaymentStatusId")] StorePayment storePayment) { if (ModelState.IsValid) { db.StorePayments.Add(storePayment); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StoreDetailId = new SelectList(db.StoreDetails, "Id", "Name", storePayment.StoreDetailId); ViewBag.StorePaymentStatusId = new SelectList(db.StorePaymentStatus, "Id", "Name", storePayment.StorePaymentStatusId); ViewBag.StorePaymentTypeId = new SelectList(db.StorePaymentTypes, "Id", "Description", storePayment.StorePaymentTypeId); return(View(storePayment)); }
// GET: Admin/StorePayments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StorePayment storePayment = store.AdminMgr.GetStorePayment((int)id); if (storePayment == null) { return(HttpNotFound()); } ViewBag.StoreDetailId = new SelectList(store.RefDbLayer.GetStoreDetails(), "Id", "Name", storePayment.StoreDetailId); ViewBag.StorePaymentStatusId = new SelectList(store.RefDbLayer.GetStorePaymentStatus(), "Id", "Name", storePayment.StorePaymentStatusId); ViewBag.StorePaymentTypeId = new SelectList(store.RefDbLayer.GetStorePaymentTypes(), "Id", "Description", storePayment.StorePaymentTypeId); return(View(storePayment)); }
// GET: Admin/StorePayments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StorePayment storePayment = db.StorePayments.Find(id); if (storePayment == null) { return(HttpNotFound()); } ViewBag.StoreDetailId = new SelectList(db.StoreDetails, "Id", "Name", storePayment.StoreDetailId); ViewBag.StorePaymentStatusId = new SelectList(db.StorePaymentStatus, "Id", "Name", storePayment.StorePaymentStatusId); ViewBag.StorePaymentTypeId = new SelectList(db.StorePaymentTypes, "Id", "Description", storePayment.StorePaymentTypeId); return(View(storePayment)); }