public DespatchEnquiryOptionResponseDto GetDespatchEnquiryForGrid(DespatchEnquiryOptionRequestDto despatchEnquiryOptionRequestDto)
        {
            DespatchEnquiryOptionResponseDto response;

            try
            {
                response = rEnquiryProvider.GetDespatchEnquiryForGrid(despatchEnquiryOptionRequestDto);
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new DespatchEnquiryOptionResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new DespatchEnquiryOptionResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }
        public HttpResponseMessage GetDespacthEnquiry(DespatchEnquiryOptionRequestDto despatchEnquiryOptionRequestDto)
        {
            HttpResponseMessage httpResponseMessage = new HttpResponseMessage();

            var filePath = System.Configuration.ConfigurationManager.AppSettings["DespatchEnquiryOption"].ToString();

            try
            {
                rEnquiryProvider.GetDespacthEnquiry(despatchEnquiryOptionRequestDto, filePath);

                var dataBytes = File.ReadAllBytes(filePath);
                //adding bytes to memory stream
                var dataStream = new MemoryStream(dataBytes);

                httpResponseMessage         = Request.CreateResponse(HttpStatusCode.OK);
                httpResponseMessage.Content = new StreamContent(dataStream);
                httpResponseMessage.Content.Headers.ContentDisposition          = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
                httpResponseMessage.Content.Headers.ContentDisposition.FileName = "DespatchEnquiryOption";
                httpResponseMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");

                return(httpResponseMessage);
            }
            catch (SSException applicationException)
            {
            }
            catch (Exception exception)
            {
            }

            return(httpResponseMessage);
        }
        public void GetDespacthEnquiry(DespatchEnquiryOptionRequestDto despatchEnquiryOptionRequestDto, string filePath)
        {
            var dataSet = enquiryRepository.GetDespatchEnquiry(despatchEnquiryOptionRequestDto.Option, despatchEnquiryOptionRequestDto.FromDate, despatchEnquiryOptionRequestDto.ToDate);

            //ConvertToExcel(dataSet, filePath);

            ExportDataSet(dataSet, filePath, "DespacthEnquiry");
        }
        public DespatchEnquiryOptionResponseDto GetDespatchEnquiryForGrid(DespatchEnquiryOptionRequestDto despatchEnquiryOptionRequestDto)
        {
            DespatchEnquiryOptionResponseDto response = new DespatchEnquiryOptionResponseDto();

            var model = enquiryRepository.GetDespatchEnquiryForGrid(despatchEnquiryOptionRequestDto.Option, despatchEnquiryOptionRequestDto.FromDate, despatchEnquiryOptionRequestDto.ToDate);

            if (model != null)
            {
                response = GetDespatchEnquiryForItemMapper((List <DespatchEnquiryOptionModel>)model.getDespatchEnquiryOptionModel, response);
            }

            return(response);
        }