Exemplo n.º 1
0
        public IActionResult EnableDisableItineraryDetails(string QRFID, string PositionId, string ItineraryId, string ItineraryDaysId, bool IsDeleted)
        {
            try
            {
                ItinerarySetRes response = new ItinerarySetRes();
                ItinerarySetReq request  = new ItinerarySetReq();

                request.QRFId           = QRFID;
                request.ItineraryId     = ItineraryId;
                request.ItineraryDaysId = ItineraryDaysId;
                request.PositionId      = PositionId;

                if (IsDeleted == false)
                {
                    IsDeleted = true;
                }
                else
                {
                    IsDeleted = false;
                }

                request.IsDeleted = IsDeleted;
                response          = coProviders.EnableDisablePosition(request, token).Result;

                if (response.ResponseStatus.Status.ToLower() == "success")
                {
                    return(Json(new { responseText = "success" }));
                }
                else
                {
                    return(Content("Error"));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public IActionResult EnableDisablePosition(string QRFID, string PositionId, string ItineraryId, string ItineraryDaysId, bool IsDeleted)
        {
            try
            {
                ItinerarySetRes response = new ItinerarySetRes();
                ItinerarySetReq request  = new ItinerarySetReq();

                request.QRFId           = QRFID;
                request.ItineraryId     = ItineraryId;
                request.ItineraryDaysId = ItineraryDaysId;
                request.PositionId      = PositionId;

                if (IsDeleted == false)
                {
                    IsDeleted = true;
                }
                else
                {
                    IsDeleted = false;
                }

                request.IsDeleted = IsDeleted;
                response          = coProviders.EnableDisablePosition(request, token).Result;

                if (response.ResponseStatus.Status.ToLower() == "success")
                {
                    return(Json(new { responseText = "success" }));
                }
                else
                {
                    return(Content("Error"));
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            //try
            //{
            //    positionGetReq = new PositionGetReq();
            //    positionGetReq.QRFID = QRFID;
            //    positionGetReq.PositionId = PositionId;
            //    positionGetReq.Type = "all";

            //    positionGetRes = positionProviders.GetPosition(positionGetReq, token).Result;

            //    if (positionGetRes.mPosition.Count == 1 && positionGetRes.mPosition[0].PositionId == PositionId)
            //    {
            //        positionSetReq = new PositionSetReq();
            //        positionSetReq.SaveType = "Complete";
            //        positionSetReq.mPosition = new List<mPosition>();
            //        positionSetReq.mPosition.Add(positionGetRes.mPosition[0]);

            //        if (IsDeleted == false)
            //            positionSetReq.mPosition[0].IsDeleted = true;
            //        else
            //            positionSetReq.mPosition[0].IsDeleted = false;

            //        positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result;

            //        if (positionSetRes.ResponseStatus.Status.ToLower() == "success")
            //        {
            //            return Json("success");
            //        }
            //        else
            //        {
            //            return Content("Error");
            //        }
            //    }
            //    return View();
            //}
            //catch (Exception ex)
            //{
            //    throw;
            //}
        }