public ActionResult Edit([Bind(Include = "NocID,Hno,No,PersonName,AprovedDate,PrintDate,Address,ElectDeptAdd,UserID,RegisterTypeID,WebStatusID")] NocCertificte noc) { ViewBag.RegisterTypeID = noc.RegisterTypeID; if (ModelState.IsValid) { db.Entry(noc).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { rt = noc.RegisterTypeID })); } return(View(noc)); }
public ActionResult Create([Bind(Include = "NocID,Hno,No,PersonName,AprovedDate,PrintDate,Address,ElectDeptAdd,UserID,RegisterTypeID,WebStatusID")] NocCertificte noc) { if (ModelState.IsValid) { noc.UserID = User.Identity.GetUserId(); noc.WEBstatusID = 1; db.NocCertifictes.Add(noc); db.SaveChanges(); return(RedirectToAction("Index", new { rt = noc.RegisterTypeID })); } ViewBag.RegisterTypeID = new SelectList(db.RegisterTypes, "RegisterTypeID", "RegisterType1", noc.RegisterTypeID); ViewBag.WebStatusID = new SelectList(db.WEBstatus, "WebStatusID", "Status", noc.WEBstatusID); return(View(noc)); }
// GET: ResidenceCertificates/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NocCertificte NocCert = db.NocCertifictes.Find(id); ViewBag.Vp = db.Configs.Select(a => a.VP).FirstOrDefault(); if (NocCert == null) { return(HttpNotFound()); } return(View(NocCert)); }
// GET: ResidenceCertificates/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NocCertificte noc = db.NocCertifictes.Find(id); ViewBag.RegisterTypeID = noc.RegisterTypeID; if (noc == null) { return(HttpNotFound()); } ViewBag.WebStatusID = new SelectList(db.WEBstatus, "WebStatusID", "Status", noc.WEBstatusID); return(View(noc)); }