public IActionResult Activities(ActivitiesViewModel model) { string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName; IRequestCookieCollection objCookies = HttpContext.Request.Cookies; SalesQuoteLibrary salesLibrary = new SalesQuoteLibrary(_configuration); PositionSetReq positionSetReq = new PositionSetReq(); bool isDuplicate = CheckDuplicateActivity(model); if (isDuplicate) { TempData["error"] = "Can not save same Activity for same day and time!!!"; model.SaveType = "full"; //return PartialView("_Activities", model); return(RedirectToAction("Activities", new { model.QRFID, model.SaveType, model.MenuViewModel.IsClone })); } else { positionSetReq = positionMapping.ActivitiesSet(model, ckUserEmailId); positionSetReq.QRFID = model.QRFID; positionSetReq.VoyagerUserID = ckLoginUser_Id; positionSetReq.FOC = model.FOC; positionSetReq.Price = model.Price; PositionSetRes positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result; if (!string.IsNullOrEmpty(model.SaveType) && model.SaveType.ToLower() == "partial") { if (positionSetRes.mPosition.Count > 0) { return(Json(new { positionSetRes.ResponseStatus.Status, positionSetRes.mPosition[0].PositionId, positionSetRes.mPosition[0].RoomDetailsInfo })); } else { return(Json(new { positionSetRes.ResponseStatus.Status })); } } else { if (positionSetRes.ResponseStatus.Status.ToLower() == "success") { TempData["success"] = "Activities saved successfully"; } else { TempData["error"] = positionSetRes.ResponseStatus.Status; } model.SaveType = "full"; if (model.ActivityDetails.Count == 1) { return(RedirectToAction("Activities", new { model.QRFID, model.SaveType, PositionId = model.ActivityDetails[0].ActivityId, IsClone = model.MenuViewModel.IsClone })); } else { return(RedirectToAction("Activities", new { model.QRFID, model.SaveType, IsClone = model.MenuViewModel.IsClone })); } } } }
public JsonResult Accomodation(AccomodationViewModel model) { positionSetReq = new PositionSetReq(); if (model.SaveType == "partial") { model.AccomodationData.RemoveAll(x => (x.AccomodationSequence == 0)); } else if (model.SaveType == "full") { model.AccomodationData.RemoveAll(x => (x.AccomodationSequence == 0 && string.IsNullOrEmpty(x.AccomodationId))); } bool IsValid = accomoMapping.ValidateAccomodationWithRouting(model, token); if (IsValid) { positionSetReq = accomoMapping.AccomodationSet(model, ckUserEmailId,token); positionSetReq.FOC = model.FOC; positionSetReq.Price = model.Price; positionSetReq.QRFID = model.MenuViewModel.QRFID; positionSetReq.VoyagerUserID = ckLoginUser_Id; positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result; if (positionSetRes.ResponseStatus.Status.ToLower() == "success") { if (model.SaveType == "partial") { return Json(new { RoomDetailsInfo = positionSetRes.mPosition[0].RoomDetailsInfo, PositionId = positionSetRes.mPosition[0].PositionId }); } else { return Json(positionSetRes.ResponseStatus); } } else { if (model.SaveType == "partial") { return Json(new { RoomDetailsInfo = positionSetRes.mPosition[0].RoomDetailsInfo, PositionId = positionSetRes.mPosition[0].PositionId }); } else { return Json(positionSetRes.ResponseStatus); } } } else { return Json(new { status = "Invalid" }); } }
public IActionResult Rail(RailViewModel model) { IRequestCookieCollection objCookies = HttpContext.Request.Cookies; SalesQuoteLibrary salesLibrary = new SalesQuoteLibrary(_configuration); PositionSetReq positionSetReq = new PositionSetReq(); positionSetReq = positionMapping.RailSet(model, ckUserEmailId); positionSetReq.FOC = model.FOC; positionSetReq.Price = model.Price; positionSetReq.QRFID = model.QRFID; positionSetReq.VoyagerUserID = ckLoginUser_Id; PositionSetRes positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result; if (!string.IsNullOrEmpty(model.SaveType) && model.SaveType.ToLower() == "partial" && positionSetRes?.mPosition != null) { if (positionSetRes.mPosition.Count > 0) { return(Json(new { positionSetRes.ResponseStatus.Status, positionSetRes.mPosition[0].PositionId, positionSetRes.mPosition[0].RoomDetailsInfo })); } else { return(Json(new { positionSetRes.ResponseStatus.Status })); } } else { if (positionSetRes?.ResponseStatus?.Status?.ToLower() == "success") { TempData["success"] = "Rail details saved successfully"; } else if (!string.IsNullOrEmpty(positionSetRes?.ResponseStatus?.Status)) { TempData["error"] = positionSetRes?.ResponseStatus?.Status; } else { TempData["error"] = "Error occured"; } model.SaveType = "full"; if (model.RailDetails.Count == 1) { return(RedirectToAction("Rail", new { model.QRFID, model.SaveType, PositionId = model.RailDetails[0].RailId, model.MenuViewModel.IsClone })); } else { return(RedirectToAction("Rail", new { model.QRFID, model.SaveType, model.MenuViewModel.IsClone })); } } }
public IActionResult LocalGuide(OthersLocalGuide model) { string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName; IRequestCookieCollection objCookies = HttpContext.Request.Cookies; SalesQuoteLibrary salesLibrary = new SalesQuoteLibrary(_configuration); PositionSetRes positionSetRes = new PositionSetRes(); PositionSetReq positionSetReq = new PositionSetReq(); OthersViewModel othersViewModel = new OthersViewModel { OthersLocalGuide = model, MenuViewModel = new MenuViewModel { IsClone = model.IsClone } }; if (model.LocalGuideDetails.Count > 0) { positionSetReq = positionMapping.OthersLocalGuideSet(othersViewModel, ckUserEmailId); positionSetReq.FOC = model.FOC; positionSetReq.Price = model.Price; positionSetReq.QRFID = model.QRFID; positionSetReq.VoyagerUserID = ckLoginUser_Id; positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result; } if (!string.IsNullOrEmpty(model.SaveType) && model.SaveType.ToLower() == "partial") { if (positionSetRes.mPosition.Count > 0) { return(Json(new { positionSetRes.ResponseStatus.Status, positionSetRes.mPosition[0].PositionId, positionSetRes.mPosition[0].RoomDetailsInfo })); } else { return(Json(new { positionSetRes.ResponseStatus.Status })); } } else { if (positionSetRes.ResponseStatus.Status.ToLower() == "success") { TempData["success"] = "Data saved successfully"; } else { TempData["error"] = positionSetRes.ResponseStatus.Status; } model.SaveType = "full"; if (model.LocalGuideDetails.Count == 1) { var prodtype = model.LocalGuideDetails[0].ProductType == "Assistant" ? "Guide" : model.LocalGuideDetails[0].ProductType == "Fee" ? "Other" : model.LocalGuideDetails[0].ProductType; return(RedirectToAction("Others", new { model.QRFID, model.SaveType, PositionId = model.LocalGuideDetails[0].OthersId, ProductType = prodtype })); } else { if (model.LocalGuideDetails.Count > 0) { var prodtype = model.LocalGuideDetails[0].ProductType == "Assistant" ? "Guide" : model.LocalGuideDetails[0].ProductType == "Fee" ? "Other" : model.LocalGuideDetails[0].ProductType; return(RedirectToAction("Others", new { model.QRFID, model.SaveType, ProductType = prodtype })); } else { return(RedirectToAction("Others", new { model.QRFID, model.SaveType })); } } } }