public ActionResult ExpertEdit(int id, DomainModels.Expert model) { var service = new ExpertService(); service.UpdateExpert(model); return(RedirectToAction("GetAllExperts")); }
public ActionResult ExpertUpdate(ExpertVM model, IEnumerable<HttpPostedFileBase> file) { ContactService oldService = new ContactService(); Contact old = new Contact(); old = oldService.Find(x => x.ContactID == ExpCOnId && x.IsActive == true); old.IsActive = false; oldService.UpdateContact(old); List<FileResultItem> fileResultItems = new List<FileResultItem> { new FileResultItem { UploadPath = model.Expert.PhotoURL } }; //RemoveAll(fileResultItems, "~/Areas/Ofiice/image/"); _expertService.UpdateExpert(model.Expert); _contactService.AddContact(new Contact { ExpertID = model.Expert.ExpertID, Address = model.Contact.Address, PhoneNumber1 = model.Contact.PhoneNumber1, PhoneNumber2 = model.Contact.PhoneNumber2, IsActive = true, Email = model.Contact.Email }); return RedirectToAction("ListExpertInfos"); }