public async Task UpdateWebsite(EditWebsiteIM data) { var website = this.websiteDataService.GetItemById(new GetInputModel { Id = data.Id }); if (!string.IsNullOrEmpty(data.CurrentPassword) && !string.IsNullOrEmpty(data.NewPassword)) { await this.userBLService.EditUser(data.UserId, data.NewPassword, data.CurrentPassword); } if (data.HomePageSnapshot != null) { var file = this.fileBlService.UploadFile(data.HomePageSnapshot, "HomePageSnapShot", website.Id, data.FileProviderName); } website.Name = data.Name; website.Url.UrlPath = data.URL; website.SystemUserId = data.UserId; website.WebsiteCategoryId = data.CategoryId; this.websiteDataService.EditItemNoReturn(website); return; }
public async Task <IActionResult> Edit([FromForm] EditWebsiteIM input) { try { await this.websiteBlService.UpdateWebsite(input); return(Ok()); } catch (Exception ex) { return(BadRequest(ex)); } }