public Materialisation GetGoAheadDepature(string token, GoAheadGetReq objGoAheadGetReq) { Materialisation model = new Materialisation(); GetGoAheadDepatureRes objGetGoAheadDepatureRes = new GetGoAheadDepatureRes(); try { objGetGoAheadDepatureRes = handoverProviders.GetGoAheadDepature(objGoAheadGetReq, token).Result; if (objGetGoAheadDepatureRes != null && objGetGoAheadDepatureRes.mGoAhead != null && objGetGoAheadDepatureRes.mGoAhead.Depatures != null && objGetGoAheadDepatureRes.mGoAhead.Depatures.Count > 0) { model.RoomInfo = objGetGoAheadDepatureRes.mGoAhead.Depatures[0].PassengerRoomInfo.Select(a => new ViewModels.RoomInfo { RoomCount = Convert.ToInt32(a.RoomCount), RoomTypeID = a.RoomTypeID, RoomTypeName = a.RoomTypeName, PaxCount = Convert.ToInt32(a.PaxCount) }).ToList(); int i = 0; model.ChildInfo = objGetGoAheadDepatureRes.mGoAhead.Depatures[0].ChildInfo.Select(a => new ViewModels.ChildInfo { Age = a.Age, ChildInfoId = a.ChildInfoId, Number = a.Number, Type = a.Type, IsDeleted = a.IsDeleted, SeqNo = i++ }).ToList(); if (model.ChildInfo == null || model.ChildInfo.Count == 0) { model.ChildInfo.Add(new ViewModels.ChildInfo { Age = 0, ChildInfoId = "", IsDeleted = false, Number = 0, SeqNo = 0, Type = "" }); model.ChildAgeList = new List <AttributeValues>(); } else { model.ChildAgeList = model.ChildInfo.Select(a => a.Age).Distinct().Select(a => new AttributeValues { AttributeValue_Id = a.ToString(), Value = a.ToString() }).ToList(); } model.ChildTypeList = objGetGoAheadDepatureRes.ChildTypeList; } else { model.RoomInfo = new List <ViewModels.RoomInfo>(); model.ChildInfo = new List <ViewModels.ChildInfo>(); } } catch (Exception ex) { } return(model); }
public IActionResult GetGoAheadDepature(string QRFID, string GoAheadId, long depatureid) { Materialisation model = new Materialisation(); if (depatureid > 0) { model = handoverMapping.GetGoAheadDepature(token, new GoAheadGetReq { QRFID = QRFID, GoAheadId = GoAheadId, DepatureId = depatureid }); model.GoAheadId = GoAheadId; model.QRFID = QRFID; model.DepartureId = depatureid; } return(PartialView("AttachToMaster/_Materialisation", model)); }
public IActionResult SetMaterialisation(Materialisation model) { model.UserName = ckUserName; if (model.ChildInfo != null && model.ChildInfo.Count > 0) { model.ChildInfo.RemoveAll(a => a.IsDeleted == true && (a.ChildInfoId == "0" || string.IsNullOrEmpty(a.ChildInfoId))); } SetMaterialisationRes objSetSetMaterialisationRes = handoverMapping.SetMaterialisation(model, token); return(Json(new { status = objSetSetMaterialisationRes.ResponseStatus.Status, msg = objSetSetMaterialisationRes.ResponseStatus.ErrorMessage })); }
public SetMaterialisationRes SetMaterialisation(Materialisation model, string token) { SetMaterialisationRes objSetMaterialisationRes = new SetMaterialisationRes(); SetMaterialisationReq objSetMaterialisationReq = new SetMaterialisationReq(); try { objSetMaterialisationReq.mGoAhead = new mGoAhead(); objSetMaterialisationReq.mGoAhead.Depatures = new List <Depatures>(); List <VGER_WAPI_CLASSES.ChildInfo> ChildInfo = new List <VGER_WAPI_CLASSES.ChildInfo>(); List <VGER_WAPI_CLASSES.PassengerRoomInfo> PassengerRoomInfo = new List <VGER_WAPI_CLASSES.PassengerRoomInfo>(); if (model.ChildInfo != null && model.ChildInfo.Count > 0) { ChildInfo = model.ChildInfo.Select(a => new VGER_WAPI_CLASSES.ChildInfo { Age = a.Age, ChildInfoId = a.ChildInfoId, IsDeleted = a.IsDeleted, Number = a.Number, Type = a.Type }).ToList(); } if (model.RoomInfo != null && model.RoomInfo.Count > 0) { PassengerRoomInfo = model.RoomInfo.Select(a => new VGER_WAPI_CLASSES.PassengerRoomInfo { RoomCount = a.RoomCount, RoomTypeID = a.RoomTypeID, RoomTypeName = a.RoomTypeName, PaxCount = a.PaxCount }).ToList(); } objSetMaterialisationReq.mGoAhead.Depatures.Add(new Depatures { DepatureId = model.DepartureId, PassengerRoomInfo = PassengerRoomInfo, ChildInfo = ChildInfo }); objSetMaterialisationReq.mGoAhead.QRFID = model.QRFID; objSetMaterialisationReq.mGoAhead.GoAheadId = model.GoAheadId; objSetMaterialisationRes = handoverProviders.SetMaterialisation(objSetMaterialisationReq, token).Result; objSetMaterialisationRes = objSetMaterialisationRes != null ? objSetMaterialisationRes : new SetMaterialisationRes(); } catch (Exception ex) { Console.WriteLine(ex.Message); } return(objSetMaterialisationRes); }