public IActionResult OnlineForm(string fio, string text) { // TODO: change projectId and USE FIO PARAMETHER var returnUrl = Url.Action("StatusFromAlmostAdmin", "Home", null, Request.Scheme); var almostAdminClient = new AlmostAdminClient( projectId, login, projectPrivateKey, returnUrl); var answer = almostAdminClient.SendQuestion(text, false); //var answer = new AnswerOnRequest { QuestionId = 1, StatusCode = Controllers.StatusCode.Success, StatusMessage = "SUCCESS WITH ME"}; if (answer.StatusCode == Controllers.StatusCode.Success) { _dataStorage.AllResponsesFromAlmostAdmin.Add(answer); // save answer to storage to keep list of questionIds } var t = JsonConvert.SerializeObject(answer); _dataStorage.totalLogList.Add(t); return(Ok()); }
public IActionResult MailForm(string mail, string text) { var almostAdminClient = new AlmostAdminClient( projectId, login, projectPrivateKey, mail); var answer = almostAdminClient.SendQuestion(text, true); //var answer = new AnswerOnRequest { QuestionId = 1, StatusCode = Controllers.StatusCode.Success, StatusMessage = "SUCCESS WITH ME"}; if (answer.StatusCode == Controllers.StatusCode.Success) { _dataStorage.AllResponsesFromAlmostAdmin.Add(answer); // save answer to storage to keep list of questionIds } var t = JsonConvert.SerializeObject(answer); _dataStorage.totalLogList.Add(t); return(Ok()); }