public HttpResponseMessage SubmitForm(List <SubmitFormFieldModel> formFields) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); FormsBLL.SubmitExternalForm(SubmitFormFieldModel.MapModelToExternalFormSubmitValues(formFields)); return(response); }
public HttpResponseMessage GetForm(string clubShortName, string formName) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); FormModel form = FormModel.MapFormModel(FormsBLL.GetForm(clubShortName, formName), true); response.Content = new ObjectContent <FormModel>(form, new JsonMediaTypeFormatter()); return(response); }
public HttpResponseMessage SubmitForm(List <SubmitFormFieldModel> formFields) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); UserPrincipal loggedInUser = (UserPrincipal)HttpContext.Current.User; FormsBLL.SubmitForm(SubmitFormFieldModel.MapModelToFormSubmitValues(formFields, loggedInUser.AccountSession.AccountId, loggedInUser.AccountSession.ClubId)); return(response); }
public HttpResponseMessage GetForm(int formId) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); UserPrincipal loggedInUser = (UserPrincipal)HttpContext.Current.User; FormModel form = FormModel.MapFormModel(FormsBLL.GetForm(loggedInUser.AccountSession.ClubId, formId), true); response.Content = new ObjectContent <FormModel>(form, new JsonMediaTypeFormatter()); return(response); }
public HttpResponseMessage GetUnansweredForms(int count) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); UserPrincipal loggedInUser = (UserPrincipal)HttpContext.Current.User; List <FormModel> forms = FormModel.MapFormModels(FormsBLL.GetUnansweredForms(loggedInUser.AccountSession.ClubId, loggedInUser.AccountSession.AccountId, count)); response.Content = new ObjectContent <List <FormModel> >(forms, new JsonMediaTypeFormatter()); return(response); }
public async Task <HttpResponseMessage> ImportExcelFile() { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); if (!Request.Content.IsMimeMultipartContent()) { response.StatusCode = HttpStatusCode.UnsupportedMediaType; } else { MultipartMemoryStreamProvider provider = new MultipartMemoryStreamProvider(); await Request.Content.ReadAsMultipartAsync(provider); Task <byte[]> fileData = provider.Contents.First().ReadAsByteArrayAsync(); int formId = int.Parse(((System.Web.HttpContextWrapper)Request.Properties["MS_HttpContext"]).Request.Form["formId"]); FormExcelImportResult result = FormsBLL.SubmitExternalFormFromExcel(fileData.Result, formId); response.Content = new ObjectContent <FormExcelImportResult>(result, new JsonMediaTypeFormatter()); } return(response); }