private async Task SubmitProfileImageForm(IBrowserFile file) { videoSaved = false; fileName = file.Name; stream = file.OpenReadStream(); imageSource = Base64ImageEncoder.EncodeImage(stream, file.ContentType); if (!string.IsNullOrEmpty(Id)) { try { var imageUrl = await ConsultantProfilesClient.UploadProfileImageAsync(Guid.Parse(Id), new FileParameter(stream, fileName)); consultant.ProfileImage = imageUrl; videoSaved = true; await imageUploadModal.Close(); } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } } }
private async Task Initialize() { if (!string.IsNullOrEmpty(Id)) { try { competenceArea = await CompetenceAreasClient.GetCompetenceAreaAsync(Id); } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } } else { competenceArea = new CompetenceArea(); } }
private async Task SubmitForm() { saved = false; error = string.Empty; try { if (string.IsNullOrEmpty(Id)) { var foo = await ConsultantProfilesClient.CreateConsultantProfileAsync(consultant as AddConsultantProfile); consultant = Mapper.Map <UpdateConsultantProfile>(foo); Id = foo.Id.ToString(); try { if (stream != null) { var imageUrl = await ConsultantProfilesClient.UploadProfileImageAsync(Guid.Parse(Id), new FileParameter(stream, fileName)); consultant.ProfileImage = imageUrl; videoSaved = true; } } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } } else { await ConsultantProfilesClient.UpdateConsultantProfileAsync(Guid.Parse(Id), consultant as UpdateConsultantProfile); } saved = true; } /* catch (ApiException exc) * { * * } * catch (HttpRequestException exc) * { * * } */ catch (Exception exc) { saved = false; error = exc.Message; } }
private async Task SubmitVideoForm(IBrowserFile file) { videoSaved = false; try { var videoUrl = await ConsultantProfilesClient.UploadVideoAsync(Guid.Parse(Id), new FileParameter(file.OpenReadStream(), file.Name)); consultant.ProfileVideo = videoUrl; videoSaved = true; await videoUploadModal.Close(); } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } }
void OnLoadComplete(System.Object sender, System.EventArgs args) { if (browserTexture.URL.IndexOf("docs.google.com") != -1) { JSHelpers.HitDismissForGoogleDocOutOfDateWarning(browserTexture); } }
private async Task OnInitalize() { if (!string.IsNullOrEmpty(Id)) { try { organization = await OrganizationsClient.GetOrganizationAsync(Id); if (organization.Address == null) { organization.Address = new Address(); } } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } } else { organization = new Organization() { Address = new Address() }; } }
private async Task OnInitialize() { userProfile = await IdentityService.GetUserProfileAsync(); if (!string.IsNullOrEmpty(Id)) { if (Guid.TryParse(Id, out var id)) { try { manager = Mapper.Map <UpdateManagerProfile>(await ManagersClient.GetManagerAsync(id)); if (manager.Address == null) { manager.Address = new Address(); } } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } } else { // Handle expected guid } } else { manager = new AddManagerProfile() { Address = new Address() }; } try { organizations = await OrganizationsClient.GetOrganizationsAsync(); } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } }
private async Task LoadMore() { var result = await ConsultantGalleryClient.GetConsultantsAsync(pageNumber ++, numberOfItemsPerPage, organization.Id, competenceArea.Id, availableFrom); consultants.AddRange(result.Items); total = result.TotalItems; await JSHelpers.ScrollToBottom(); }
void OnLoadComplete(System.Object sender, System.EventArgs args) { if (!minimizeMenu) { return; } JSHelpers.MinimizeGoogleDocMenus(browserTexture); JSHelpers.HitDismissForGoogleDocOutOfDateWarning(browserTexture); }
void OnLoadComplete(System.Object sender, System.EventArgs args) { if (bTex.URL.IndexOf("docs.google.com") != -1) { JSHelpers.HitDismissForGoogleDocOutOfDateWarning(bTex); } if (bTex.URL.IndexOf("twiddla.com") != -1) { JSHelpers.EnterTwiddlaUserName(bTex, GameManager.Inst.LocalPlayer.Name); JSHelpers.CloseTwiddlaSideNav(bTex); } // auto zoom in WebPanel wp = gameObject.GetComponent <WebPanel>(); wp.focusGainEngagesSnapCam = (bTex.URL.IndexOf("docs.google.com/document") != -1 || bTex.URL.IndexOf("docs.google.com/spreadsheet") != -1); }
private async Task OnInitialize() { try { var result = await UserClient.GetUserProfileAsync(null); switch (result) { case ClientProfile cp: user = Mapper.Map <UpdateClientProfile>(cp); break; case ConsultantProfile cp: user = Mapper.Map <UpdateConsultantProfile>(cp); break; case ManagerProfile cp: user = Mapper.Map <UpdateManagerProfile>(cp); break; default: user = Mapper.Map <UpdateUserProfile>(result); break; } if (user.Address == null) { user.Address = new Address(); } } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } }
public string AvatarOptionsToJson(Dictionary <string, int> avatarOptions) { return(JSHelpers.DictionaryToJSON(avatarOptions)); }
private async Task OnInitialize() { try { var foo = Mapper.ProjectTo <Models.ListItem>(( await CompetenceAreasClient.GetCompetenceAreasAsync()).AsQueryable()).ToList(); foo.Insert(0, new Models.ListItem() { Id = null, Name = "All" }); competenceAreas = foo; competenceArea = competenceAreas.FirstOrDefault(); } /* catch (ApiException exc) * { * } * catch (HttpRequestException exc) * { * } */ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } try { var foo = Mapper.ProjectTo <Models.ListItem>(( await OrganizationsClient.GetOrganizationsAsync()).AsQueryable()).ToList(); foo.Insert(0, new Models.ListItem() { Id = null, Name = "All" }); organizations = foo; organization = organizations.FirstOrDefault(); } /*catch (ApiException exc) * { * * } * catch (HttpRequestException exc) * { * * }*/ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } try { var result = await ConsultantGalleryClient.GetConsultantsAsync(pageNumber ++, numberOfItemsPerPage, null, null, null); consultants = new List <ProfileShort>(); consultants.AddRange(result.Items); total = result.TotalItems; } /*catch (ApiException exc) * { * * } * catch (HttpRequestException exc) * { * * }*/ catch (Exception exc) { await JSHelpers.Alert(exc.Message); } }