public ActionResult Edit(ArchitectAssociate ArchitectAssociate) { ArchitectAssociate oArchitectAssociate = new ArchitectAssociate(); oArchitectAssociate.ArchitectAssociateID = System.Convert.ToInt32(ArchitectAssociate.ArchitectAssociateID); oArchitectAssociate = ArchitectAssociateData.Select_Record(ArchitectAssociate); if (ModelState.IsValid) { bool bSucess = false; bSucess = ArchitectAssociateData.Update(oArchitectAssociate, ArchitectAssociate); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Update"); } } // ComboBox ViewData["ArchitectID"] = new SelectList(ArchitectAssociate_ArchitectData.List(), "ArchitectID", "ArchitectName", ArchitectAssociate.ArchitectID); return(View(ArchitectAssociate)); }
public ActionResult Create([Bind(Include = "ArchitectID" + "," + "AssociateName" + "," + "ContactNo" + "," + "EMail" )] ArchitectAssociate ArchitectAssociate) { if (ModelState.IsValid) { bool bSucess = false; bSucess = ArchitectAssociateData.Add(ArchitectAssociate); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Insert"); } } // ComboBox ViewData["ArchitectID"] = new SelectList(ArchitectAssociate_ArchitectData.List(), "ArchitectID", "ArchitectName", ArchitectAssociate.ArchitectID); return(View(ArchitectAssociate)); }
// GET: /ArchitectAssociate/Edit/<id> public ActionResult Edit( Int32?ArchitectAssociateID ) { if ( ArchitectAssociateID == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ArchitectAssociate ArchitectAssociate = new ArchitectAssociate(); ArchitectAssociate.ArchitectAssociateID = System.Convert.ToInt32(ArchitectAssociateID); ArchitectAssociate = ArchitectAssociateData.Select_Record(ArchitectAssociate); if (ArchitectAssociate == null) { return(HttpNotFound()); } // ComboBox ViewData["ArchitectID"] = new SelectList(ArchitectAssociate_ArchitectData.List(), "ArchitectID", "ArchitectName", ArchitectAssociate.ArchitectID); return(View(ArchitectAssociate)); }
// GET: /ArchitectAssociate/Create public ActionResult Create() { // ComboBox ViewData["ArchitectID"] = new SelectList(ArchitectAssociate_ArchitectData.List(), "ArchitectID", "ArchitectName"); return(View()); }