protected async void FormSubmit() { int.TryParse(ParentId, out int parentId); model.ParentId = parentId; #region 일 업로드 관련 추가 코드 영역 if (selectedFiles != null && selectedFiles.Length > 0) { // 파일 업로드 var file = selectedFiles.FirstOrDefault(); var fileName = ""; int fileSize = 0; if (file != null) { fileName = file.Name; fileSize = Convert.ToInt32(file.Size); fileName = await FileStorageManager.UploadAsync(file.Data, file.Name, "", true); model.FileName = fileName; model.FileSize = fileSize; } } #endregion foreach (var m in Models) { m.FileName = model.FileName; m.FileSize = model.FileSize; await UploadRepositoryAsyncReference.AddAsync(m); } NavigationManagerReference.NavigateTo("/BriefingLogs"); }
protected async void FormSubmit() { int.TryParse(ParentId, out int parentId); model.ParentId = parentId; #region 일 업로드 관련 추가 코드 영역 if (selectedFiles != null && selectedFiles.Length > 0) { // 파일 업로드 var file = selectedFiles.FirstOrDefault(); var fileName = ""; int fileSize = 0; if (file != null) { fileName = file.Name; fileSize = Convert.ToInt32(file.Size); // 첨부 파일 삭제 await FileStorageManager.DeleteAsync(model.FileName, ""); // 다시 업로드 fileName = await FileStorageManager.UploadAsync(file.Data, file.Name, "", true); model.FileName = fileName; model.FileSize = fileSize; } } #endregion await UploadRepositoryAsyncReference.EditAsync(model); NavigationManagerReference.NavigateTo("/Uploads"); }
protected override async Task OnInitializedAsync() { #region SignalR hubConnection = new HubConnectionBuilder() .WithUrl(NavigationManagerReference.ToAbsoluteUri("/noticehub")) .Build(); hubConnection.On <string, string>("ReceiveMessage", (user, message) => { var encodeMsg = $"{user}: {message}"; messages.Add(encodeMsg); StateHasChanged(); }); await hubConnection.StartAsync(); #endregion if (string.IsNullOrEmpty(this.searchQuery)) { await DisplayData(); } else { await SearchData(); } }
protected async void FormSubmit() { int.TryParse(ParentId, out int parentId); model.ParentId = parentId; await NoticeRepositoryAsyncReference.EditAsync(model); NavigationManagerReference.NavigateTo("/Boards/Notices"); }
protected async void FormSubmit() { int.TryParse(ParentId, out int parentId); model.ParentId = parentId; await UploadRepositoryAsyncReference.AddAsync(model); NavigationManagerReference.NavigateTo("/Boards/Uploads"); }
protected async void FormSubmit() { int.TryParse(ParentId, out int parentId); model.ParentId = parentId; await NoticeRepositoryAsyncReference.AddAsync(model); //Socketlabs.SendMessage(model.Title, model.Content, ""); // 전체메일 발송 NavigationManagerReference.NavigateTo("/Boards/Notices"); }
protected async void DeleteClick() { bool isDelete = await JSRuntime.InvokeAsync <bool>("confirm", $"{Id}번 글을 정말로 삭제하시겠습니까?"); if (isDelete) { await UploadRepositoryAsyncReference.DeleteAsync(Id); NavigationManagerReference.NavigateTo("/Boards/Uploads"); } else { await JSRuntime.InvokeAsync <object>("alarm", "취소되었습니다."); } }
protected void NameClick(int id) { NavigationManagerReference.NavigateTo($"/Boards/Notices/Details/{id}"); }
protected async void FormSubmit() { await NoticeRepositoryAsyncReference.AddAsync(model); NavigationManagerReference.NavigateTo("/Notices"); }
protected void NameClick(int id) { NavigationManagerReference.NavigateTo($"/Libraries/Details/{id}"); }
protected void NameClick(int id) { NavigationManagerReference.NavigateTo($"/BriefingLogs/Details/{id}"); }