public async Task <CVDetailDTO> GetDetailsCV(int CVId) { CVDetailDTO output = new CVDetailDTO(); string apiUrl = $"/api/v1/CurriculumVitae/GetDetailsCV"; string paramRequest = $"?CVId={CVId}"; var response = await _client.GetAsync(apiUrl + paramRequest); if (response.IsSuccessStatusCode) { string responseStream = await response.Content.ReadAsStringAsync(); output = JsonConvert.DeserializeObject <CVDetailDTO>(responseStream); } return(output); }
public async Task <IActionResult> CurriculumVitaeDetail() { //Get Menu ViewBag.MenuMachine = await _repoWrapper.ProductCategory.GetLstMenuByParentId(654); ViewBag.MenuMaterials = await _repoWrapper.ProductCategory.GetLstMenuByParentId(652); ViewBag.MenuServices = await _repoWrapper.ProductCategory.GetLstMenuByParentId(651); //get CategoryCurriculum ViewBag.LstCareerCategory = await _repoWrapper.CurriculumVitae.GetAllCareerCategory(); CVDetailDTO model = new CVDetailDTO(); var url = RouteData.Values["url"]; int ID = Utils.RegexRouteIdFromUrl(url.ToString()); if (ID == 0) // Error Redirect 301 { //Response.StatusCode = 301; //Response.Headers("Location", "https://daninhbinhvinhquang.vn/may-de-ban"); //Response.End(); } else { model = await _repoWrapper.CurriculumVitae.GetDetailsCV(ID); ViewBag.RelateCV = await _repoWrapper.CurriculumVitae.GetRelateCurriculumVitae((int)model.CVDetails.CareerCategoryId, model.CVDetails.Id); var CareeCateInfo = await _repoWrapper.CurriculumVitae.GetDetailCareerCategory((int)model.CVDetails.CareerCategoryId); ViewBag.CareeName = CareeCateInfo.Name; ViewBag.CareeUrl = CareeCateInfo.URL; ViewBag.CurriculumVitaeId = ID; } return(View(model)); }