Example #1
0
        public async Task <FormsListResponse> GetForms(FormsListRequest model)
        {
            try
            {
                var trans = GetTrans(model.CallerOrgCode, model.UserName, model.OrderId);
                if (trans == null)
                {
                    //TODO: Log Something
                    throw new ADMServerException("Couldn't find Trans");
                }

                var formsList = trans.FormInstances.ToList();
                await Task.Delay(1);

                var retObj = new FormsListResponse()
                {
                    CorrelationGuid = model.CorrelationGuid,
                    FormInstances   = MapFormInstances(formsList, model.IncludePdfString)
                };

                return(retObj);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Example #2
0
        public async Task <IHttpActionResult> Get([FromUri] FormsListRequest model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                FormsListResponse response = await _service.GetForms(model);

                return(Ok(response));
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }
        }