public IActionResult CheckFrame([FromForm] RxoCheckFrameViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var newCheckFrameRequest = new RxoCheckFrameRequest()
                    {
                        Kunnr = model.DoorNr,
                        Upc   = model.FrameUpc
                    };

                    // Invoke the Service
                    var RxoWsResponse = luxotticaRxoSvc.CallCheckFrame(newCheckFrameRequest);

                    ViewBag.UserMessage = RxoWsResponse;
                    ModelState.Clear();
                }
                else
                {
                    // Show the errors
                    ViewBag.UserMessage = "Error";
                }
            }
            catch (Exception ex)
            {
                logger.LogError($"Luxottica CheckFrame Error : {ex}");
            }
            return(View());
        }
Exemple #2
0
        public IActionResult Post([FromBody] RxoCheckFrameViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var newCheckFrameRequest = new RxoCheckFrameRequest()
                    {
                        Kunnr = model.DoorNr,
                        Upc   = model.FrameUpc
                    };

                    // Invoke the Service
                    var RxoWsResponse = luxotticaRxoSvc.CallCheckFrame(newCheckFrameRequest);

                    return(Ok(RxoWsResponse));
                }
                else
                {
                    // Show the errors
                    return(BadRequest("CheckFrame invalid model"));
                }
            }
            catch (Exception ex)
            {
                logger.LogError($"Luxottica CheckFrame Error : {ex}");
                return(BadRequest("CheckFrame Error"));
            }
        }