Example #1
0
        // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



        public bool QuoteRequestMediaListInsert(QRMediaInsertListRequest model)
        {
            bool isSuccessful = false;


            foreach (int mediaIdItem in model.MediaIdList)
            {
                QRMediaInsertRequest mediaItem = new QRMediaInsertRequest();
                mediaItem.MediaId        = mediaIdItem;
                mediaItem.QuoteRequestId = model.QuoteRequestId;
                //Call Service method to sent MediaItem
                InsertQuoteRequestMediaItem(mediaItem);
            }

            isSuccessful = true;

            return(isSuccessful);
        }
        public HttpResponseMessage QRMediaListInsert(QRMediaInsertListRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            //create response model
            // item = true

            ItemResponse <bool> response = new ItemResponse <bool>();

            response.Item = true;

            _QuoteRequestService.QuoteRequestMediaListInsert(model);


            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }