public ActionResult DeleteConfirmed(int id) { Table_Company table_Company = db.Table_Company.Find(id); db.Table_Company.Remove(table_Company); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_Company,companyPersonName,companyPersonSurname,companyPersonSecName,companyName,companyPackage,companyPhone,companyAdress,companySite,companyMail,companyFax,companyInfo,companyPackEndDate")] Table_Company table_Company) { if (ModelState.IsValid) { db.Entry(table_Company).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(table_Company)); }
// GET: Table_Company/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Table_Company table_Company = db.Table_Company.Find(id); if (table_Company == null) { return(HttpNotFound()); } return(View(table_Company)); }
//[HttpPost] public ActionResult Details(int?id) { Table_Company company = new Table_Company(); List <Table_Company> modelcomp = db.Table_Company.Include(p => p.Table_Ads).ToList(); foreach (Table_Company ta in modelcomp) { foreach (Table_Ads tr in ta.Table_Ads) { if (id == tr.id_Ad) { company = ta; break; } } } return(View("Details", company)); }