public ActionResult GridIndex([Bind(Prefix = "SearchCondition")] ADDRESS_MASTER address) { //var addressMaster = from a in db.ADDRESS_MASTER select a; AddressViewModel viewModel = new AddressViewModel(db).Initialize(address).LordRecordObjects(); return(View(viewModel)); }
public ActionResult DeleteConfirmed(int id) { ADDRESS_MASTER aDDRESS_MASTER = db.ADDRESS_MASTER.Find(id); db.ADDRESS_MASTER.Remove(aDDRESS_MASTER); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name,furigana,gender,bloodType,birthDay,homePhone,cellPhone,mailAddress,postalCode,homeAddress,homeFurigana")] ADDRESS_MASTER aDDRESS_MASTER) { if (ModelState.IsValid) { db.Entry(aDDRESS_MASTER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aDDRESS_MASTER)); }
// GET: address/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ADDRESS_MASTER aDDRESS_MASTER = db.ADDRESS_MASTER.Find(id); if (aDDRESS_MASTER == null) { return(HttpNotFound()); } return(View(aDDRESS_MASTER)); }
public ActionResult Create([Bind(Prefix = "SearchCondition")] ADDRESS_MASTER aDDRESS_MASTER) { AddressViewModel viewModel = new AddressViewModel(db).Initialize(); viewModel.SearchCondition = aDDRESS_MASTER; if (ModelState.IsValid) { db.ADDRESS_MASTER.Add(aDDRESS_MASTER); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(viewModel)); }
public AddressViewModel Initialize(ADDRESS_MASTER address) { SearchCondition = address; return(this); }