public ActionResult Create(PaymentModeType ObjPaymentModeType) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); try { if (ModelState.IsValid) { db.PaymentModeTypes.Add(ObjPaymentModeType); db.SaveChanges(); sb.Append("Sumitted"); return(Content(sb.ToString())); } else { foreach (var key in this.ViewData.ModelState.Keys) { foreach (var err in this.ViewData.ModelState[key].Errors) { sb.Append(err.ErrorMessage + "<br/>"); } } } } catch (Exception ex) { sb.Append("Error :" + ex.Message); } return(Content(sb.ToString())); }
// GET: /PaymentModeType/MultiViewIndex/5 public ActionResult MultiViewIndex(int?id) { PaymentModeType ObjPaymentModeType = db.PaymentModeTypes.Find(id); ViewBag.IsWorking = 0; if (id > 0) { ViewBag.IsWorking = id; } return(View(ObjPaymentModeType)); }
// GET: /PaymentModeType/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaymentModeType ObjPaymentModeType = db.PaymentModeTypes.Find(id); if (ObjPaymentModeType == null) { return(HttpNotFound()); } return(View(ObjPaymentModeType)); }
public ActionResult DeleteConfirmed(int id) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); try { PaymentModeType ObjPaymentModeType = db.PaymentModeTypes.Find(id); db.PaymentModeTypes.Remove(ObjPaymentModeType); db.SaveChanges(); sb.Append("Sumitted"); return(Content(sb.ToString())); } catch (Exception ex) { sb.Append("Error :" + ex.Message); } return(Content(sb.ToString())); }