public async Task <IActionResult> EditBloodCenter(int id) { var bloodCenter = await this.informationsService.GetBloodCenterByIdAsync(id); var model = new EditBloodCenterViewModel { Id = bloodCenter.Id, Address = bloodCenter.Address, Phone = bloodCenter.Phone, EventPhone = bloodCenter.EventPhone, Email = bloodCenter.Email, WorkingHours = bloodCenter.WorkingHours, Name = bloodCenter.Name, }; return(this.View(model)); }
public async Task <IActionResult> EditBLoodCenter(EditBloodCenterViewModel bloodCenter) { var model = new BloodCentersServiceModel { Id = bloodCenter.Id, Address = bloodCenter.Address, Phone = bloodCenter.Phone, EventPhone = bloodCenter.EventPhone, Email = bloodCenter.Email, WorkingHours = bloodCenter.WorkingHours, Name = bloodCenter.Name, }; await this.informationsService.EditBloodCenterAsync(model); return(this.Redirect("/Informations/BloodCenters")); }