//[Authorize(Roles = "Administrator")] public ActionResult DeleteConfirmed(short id) { PaymentModeMaster paymentModeMaster = db.PaymentModeMaster.Find(id); db.PaymentModeMaster.Remove(paymentModeMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteConfirmed(int id) { PaymentModeMaster paymentModeMaster = await db.PaymentModeMasters.FindAsync(id); db.PaymentModeMasters.Remove(paymentModeMaster); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
//[Authorize(Roles = "Administrator")] public ActionResult Edit([Bind(Include = "PaymentModeId,PaymentMode")] PaymentModeMaster paymentModeMaster) { if (ModelState.IsValid) { db.Entry(paymentModeMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(paymentModeMaster)); }
//[Authorize(Roles = "Administrator")] public ActionResult Create([Bind(Include = "PaymentModeId,PaymentMode")] PaymentModeMaster paymentModeMaster) { if (ModelState.IsValid) { db.PaymentModeMaster.Add(paymentModeMaster); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(paymentModeMaster)); }
public async Task <ActionResult> Create([Bind(Include = "PaymentModeID,PaymentMode")] PaymentModeMaster paymentModeMaster) { if (ModelState.IsValid) { db.PaymentModeMasters.Add(paymentModeMaster); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(paymentModeMaster)); }
// GET: Masters/PaymentModeMasters/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaymentModeMaster paymentModeMaster = await db.PaymentModeMasters.FindAsync(id); if (paymentModeMaster == null) { return(HttpNotFound()); } return(View(paymentModeMaster)); }
// GET: TMS/PaymentMode/Details/5 //[Authorize(Roles = "Administrator")] public ActionResult Details(short?id) { UserViewModel userdetails = generic.GetUserDetail(User.Identity.GetUserId()); ViewData["UserProfile"] = userdetails; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaymentModeMaster paymentModeMaster = db.PaymentModeMaster.Find(id); if (paymentModeMaster == null) { return(HttpNotFound()); } return(View(paymentModeMaster)); }
// GET: TMS/PaymentMode/Edit/5 //[Authorize(Roles = "Administrator")] public ActionResult Edit(short?id, bool status = false) { UserViewModel userdetails = generic.GetUserDetail(User.Identity.GetUserId()); ViewData["UserProfile"] = userdetails; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ViewBag.Result = "Failed"; if (status == true) { ViewBag.Result = "Succeeded"; } PaymentModeMaster paymentModeMaster = db.PaymentModeMaster.Find(id); if (paymentModeMaster == null) { return(HttpNotFound()); } return(View(paymentModeMaster)); }