public ActionResult DeleteConfirmed(int id) { CompanyName_tbl companyName_tbl = db.CompanyName_tbl.Find(id); db.CompanyName_tbl.Remove(companyName_tbl); db.SaveChanges(); return(View(db.CompanyName_tbl.ToList())); }
public ActionResult DeleteConfirmed(int id) { CompanyName_tbl companyName_tbl = db.CompanyName_tbl.Find(id); db.CompanyName_tbl.Remove(companyName_tbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "companyID,companyName,shortCode,corpInfo,updateDate,countryID,exchangeCodeID,companyTypeID,businessSectorID")] CompanyName_tbl companyName_tbl) { if (ModelState.IsValid) { db.Entry(companyName_tbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.businessSectorID = new SelectList(db.BusinessSector_tbl, "businessSectorID", "businessSectorDesc", companyName_tbl.businessSectorID); ViewBag.companyTypeID = new SelectList(db.CompanyType_tbl, "companyTypeID", "companyTypeDesc", companyName_tbl.companyTypeID); ViewBag.exchangeCodeID = new SelectList(db.Exchange_tbl, "exchangeCodeID", "exchangeName", companyName_tbl.exchangeCodeID); return(View(companyName_tbl)); }
// GET: CompanyName_tbl/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyName_tbl companyName_tbl = db.CompanyName_tbl.Find(id); if (companyName_tbl == null) { return(HttpNotFound()); } return(View(companyName_tbl)); }
// GET: CompanyName_tbl/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyName_tbl companyName_tbl = db.CompanyName_tbl.Find(id); if (companyName_tbl == null) { return(HttpNotFound()); } ViewBag.businessSectorID = new SelectList(db.BusinessSector_tbl, "businessSectorID", "businessSectorDesc", companyName_tbl.businessSectorID); ViewBag.companyTypeID = new SelectList(db.CompanyType_tbl, "companyTypeID", "companyTypeDesc", companyName_tbl.companyTypeID); ViewBag.exchangeCodeID = new SelectList(db.Exchange_tbl, "exchangeCodeID", "exchangeName", companyName_tbl.exchangeCodeID); return(View(companyName_tbl)); }