public IActionResult ContactingPersonView() { InitialForm form = JsonConvert.DeserializeObject <InitialForm>((string)TempData["Form"]); form.SerializedCopy = JsonConvert.SerializeObject(form); return(View(form)); }
public IActionResult DetailedForm(InitialForm initForm) { ModelState.Clear(); InitialForm form = JsonConvert.DeserializeObject <InitialForm>(initForm.SerializedCopy); var detailedForm = AutoMapper.Mapper.Map <DetailedForm>(form); return(View(detailedForm)); }
public IActionResult MarkAsOcupated(string userId, string consultantId) { try { InitialForm result = new InitialForm(); Hubs.ChatHub.AddToOcupated(userId, consultantId); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult ApplyForm(InitialForm form) { try { if (!ModelState.IsValid) { return(View("Index", form)); } TempData["Form"] = JsonConvert.SerializeObject(form); return(RedirectToAction("ContactingPersonView", "Chat")); } catch (Exception e) { return(RedirectToAction("Error", "Home", new { errorType = "", errorName = e.Message, errorDetails = "" })); } }
public IActionResult GetInitialFormFor(string userId) { try { InitialForm result = new InitialForm(); if (Global.UserInitialForms.ContainsKey(userId)) { result = Global.UserInitialForms[userId]; } return(ViewComponent("DisplayInitialForm", new { form = result })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult AddToChatQueue(string userId, InitialForm form) { try { if (Global.UserInitialForms.ContainsKey(userId)) { Global.UserInitialForms[userId] = form; } else { Global.UserInitialForms.Add(userId, form); } return(Ok()); } catch (Exception ex) { return(BadRequest(ex)); } }
public IViewComponentResult Invoke(InitialForm form) { return(View(form)); }