public ActionResult Edit([Bind(Include = "ResidenceCertificateID,PersonName,BirthDate,BirthPlace,NameOfMother,NameOfFather,Address,Since,TDate,IsDead,UserID,RegisterTypeID,WebStatusID")] ResidenceCertificate residenceCertificate) { ViewBag.RegisterTypeID = residenceCertificate.RegisterTypeID; if (ModelState.IsValid) { db.Entry(residenceCertificate).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { rt = residenceCertificate.RegisterTypeID })); } return(View(residenceCertificate)); }
// GET: ResidenceCertificates/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ResidenceCertificate residenceCertificate = db.ResidenceCertificates.Find(id); if (residenceCertificate == null) { return(HttpNotFound()); } ViewBag.WebStatusID = new SelectList(db.WEBstatus, "WebStatusID", "Status", residenceCertificate.WebStatusID); return(View(residenceCertificate)); }
public ActionResult Create([Bind(Include = "ResidenceCertificateID,PersonName,BirthDate,BirthPlace,NameOfMother,NameOfFather,Address,Since,IsDead,UserID,RegisterTypeID,WebStatusID")] ResidenceCertificate residenceCertificate) { if (ModelState.IsValid) { residenceCertificate.UserID = User.Identity.GetUserId(); residenceCertificate.WebStatusID = 1; db.ResidenceCertificates.Add(residenceCertificate); db.SaveChanges(); return(RedirectToAction("Index", new { rt = residenceCertificate.RegisterTypeID })); } ViewBag.RegisterTypeID = new SelectList(db.RegisterTypes, "RegisterTypeID", "RegisterType1", residenceCertificate.RegisterTypeID); ViewBag.WebStatusID = new SelectList(db.WEBstatus, "WebStatusID", "Status", residenceCertificate.WebStatusID); return(View(residenceCertificate)); }
// GET: ResidenceCertificates/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ResidenceCertificate residenceCertificate = db.ResidenceCertificates.Find(id); ViewBag.ph = db.Configs.Select(a => a.PanchHead).FirstOrDefault(); if (residenceCertificate == null) { return(HttpNotFound()); } return(View(residenceCertificate)); }