public async Task <IActionResult> IndexPost(int id, [FromBody] ClientMotherModel motherRequest) { if (motherRequest == null) { return(BadRequest()); } motherRequest.AppointmentDate = DateTime.Now; motherRequest.IsCompleted = true; var profile = await _scanCenterProfileQuery.GetById(id); if (profile != null) { ViewData["ProfileId"] = profile.Id; ViewData["UniqueName"] = profile.UniqueName; var scopeid = await _clientMotherQuery.CreateMotherProfile(profile.Id, motherRequest); string baseUrl = $"{Request.Scheme}://{Request.Host}"; _emailManager.SMTPSettings = _appSettings.SMTPSettings; string referid = await _cryptography.Encrypt(motherRequest.Id.ToString(), _appSettings); _emailManager.SendNotification(motherRequest, profile, baseUrl); return(Ok(new { id = scopeid })); } return(BadRequest()); }
public async Task <IActionResult> DeActivateProfile(int id) { if (id == 0) { return(BadRequest()); } ViewBag.Id = id; var app = await _scanCenterProfileQuery.GetById(id); if (app == null) { return(BadRequest()); } await _scanCenterProfileQuery.DeActivateProfile(id); return(Ok(new { success = "success" })); }
public async Task <IViewComponentResult> InvokeAsync(int profileId) { var profile = await _scanCenterProfileQuery.GetById(profileId); return(View("/Areas/Mother/Views/Shared/Components/MotherHeader/MotherHeader.cshtml", profile)); }