public ActionResult DeleteConfirmed(int id) { SYS_PartyType sYS_PartyType = db.SYS_PartyType.Find(id); db.SYS_PartyType.Remove(sYS_PartyType); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: SYS_PartyType/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SYS_PartyType sYS_PartyType = db.SYS_PartyType.Find(id); if (sYS_PartyType == null) { return(HttpNotFound()); } return(View(sYS_PartyType)); }
public ActionResult Create([Bind(Include = "PartyTypeID,PartyType,Remarks,Created,Modified,UserID")] SYS_PartyType sYS_PartyType) { if (ModelState.IsValid) { sYS_PartyType.Created = DateTime.Now; sYS_PartyType.Modified = DateTime.Now; if (Session["UserID"] != null) { sYS_PartyType.UserID = Convert.ToInt16(Session["UserID"].ToString()); } db.SYS_PartyType.Add(sYS_PartyType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sYS_PartyType)); }
public ActionResult Edit([Bind(Include = "PartyTypeID,PartyType,Remarks,Created,Modified,UserID")] SYS_PartyType sYS_PartyType) { if (sYS_PartyType.PartyTypeID > 0) { if (sYS_PartyType.Remarks == null || sYS_PartyType.Remarks == "") { ModelState.AddModelError("", "Enter Remarks"); return(View(sYS_PartyType)); } } if (ModelState.IsValid) { db.Entry(sYS_PartyType).State = EntityState.Modified; sYS_PartyType.Modified = Convert.ToDateTime(DateTime.Now); if (Session["UserID"] != null) { sYS_PartyType.UserID = Convert.ToInt16(Session["UserID"].ToString()); } db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sYS_PartyType)); }
// GET: SYS_PartyType/Create public ActionResult Create() { SYS_PartyType sYS_PartyType = new SYS_PartyType(); return(View("Edit", sYS_PartyType)); }