public async Task <ActionResult> DeleteConfirmed(int id) { Deparmant deparmant = await db.Departmants.FindAsync(id); db.Departmants.Remove(deparmant); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] Deparmant deparmant) { if (ModelState.IsValid) { db.Entry(deparmant).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(deparmant)); }
// GET: Admin/DeparmantsAdmin/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Deparmant deparmant = await db.Departmants.FindAsync(id); if (deparmant == null) { return(HttpNotFound()); } return(View(deparmant)); }
public DepartmantCreateView(Deparmant deparmant, IEnumerable <dynamic> Identities, IEnumerable <dynamic> universities) { this.universities = universities; this.Identities = Identities; this.deparmant = deparmant; }