public async Task <ActionResult> Edit([Bind(Include = "CompanyMemberPhotoId,FileName")] CompanyMemberPhoto companyMemberPhoto) { if (ModelState.IsValid) { db.Entry(companyMemberPhoto).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index", "CompanyMembers")); } ViewBag.CompanyMemberPhotoId = new SelectList(db.CompanyMembers, "CompanyMemberId", "Name", companyMemberPhoto.CompanyMemberPhotoId); return(View(companyMemberPhoto)); }
public async Task <ActionResult> DeleteConfirmed(int id, string deleteFileName) { PhotoFileManager manager = new PhotoFileManager(PhotoManagerType.Member); manager.Delete(deleteFileName, false); CompanyMemberPhoto companyMemberPhoto = await db.CompanyMemberPhotoes.FindAsync(id); db.CompanyMemberPhotoes.Remove(companyMemberPhoto); await db.SaveChangesAsync(); return(RedirectToAction("Index", "CompanyMembers")); }
// GET: CompanyMemberPhotoes/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyMemberPhoto companyMemberPhoto = await db.CompanyMemberPhotoes.FindAsync(id); if (companyMemberPhoto == null) { return(HttpNotFound()); } return(View(companyMemberPhoto)); }
// GET: CompanyMemberPhotoes/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CompanyMemberPhoto companyMemberPhoto = await db.CompanyMemberPhotoes.FindAsync(id); if (companyMemberPhoto == null) { return(HttpNotFound()); } ViewBag.CompanyMemberPhotoId = new SelectList(db.CompanyMembers, "CompanyMemberId", "Name", companyMemberPhoto.CompanyMemberPhotoId); return(View(companyMemberPhoto)); }