예제 #1
0
        public IActionResult ContactingPersonView()
        {
            InitialForm form = JsonConvert.DeserializeObject <InitialForm>((string)TempData["Form"]);

            form.SerializedCopy = JsonConvert.SerializeObject(form);
            return(View(form));
        }
예제 #2
0
        public IActionResult DetailedForm(InitialForm initForm)
        {
            ModelState.Clear();
            InitialForm form         = JsonConvert.DeserializeObject <InitialForm>(initForm.SerializedCopy);
            var         detailedForm = AutoMapper.Mapper.Map <DetailedForm>(form);

            return(View(detailedForm));
        }
예제 #3
0
 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));
     }
 }
예제 #4
0
        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 = "" }));
            }
        }
예제 #5
0
        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));
            }
        }
예제 #6
0
        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));
 }