public ActionResult Create([Bind(Include = "OwnerShipTitle,IsActive")] OwnerShipType ownerShipType) { if (ModelState.IsValid) { ownerShipType.EntryDate = DateTime.Now; db.OwnerShipTypes.Add(ownerShipType); db.SaveChanges(); return(RedirectToAction("Index")); } InitPage("Create"); return(View("OwnerShipType", ownerShipType)); }
// GET: OwnerShipTypes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OwnerShipType ownerShipType = db.OwnerShipTypes.Find(id); if (ownerShipType == null) { return(HttpNotFound()); } InitPage("Edit"); return(View("OwnerShipType", ownerShipType)); }
public ActionResult Edit([Bind(Include = "OwnerShipTypeID,OwnerShipTitle,IsActive")] OwnerShipType ownerShipType) { if (ModelState.IsValid) { var rowExist = db.OwnerShipTypes.Find(ownerShipType.OwnerShipTypeID); if (rowExist != null) { rowExist.IsActive = ownerShipType.IsActive; rowExist.OwnerShipTitle = ownerShipType.OwnerShipTitle; db.SaveChanges(); } return(RedirectToAction("Index")); } InitPage("Edit"); return(View("OwnerShipType", ownerShipType)); }
public User(string name, OwnerShipType ownershiptype, ActivityProfile acitvityProfile, Person contactPerson, Country country, City city, Location location, string email) { OwnershipType = ownershiptype; ActivityProfile = acitvityProfile; }