public async Task <GoAheadSetRes> SetGoAhead([FromBody] GoAheadSetReq request) { var response = new GoAheadSetRes(); try { if (request != null) { response = await _handoverRepository.SetGoAhead(request); if (response != null && response.ResponseStatus != null && !string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status.ToLower() == "Success".ToLower() && !string.IsNullOrEmpty(request.mGoAhead.QRFID) && !string.IsNullOrEmpty(request.VoyagerUserId)) { Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.mGoAhead.QRFID, request.VoyagerUserId).Result); } } else { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "Details can not be blank."; } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message; } return(response); }
public async Task <GoAheadSetRes> SendMailHandoverBooking(GoAheadGetReq goAheadGetReq, string ticket) { GoAheadSetRes objGoAheadSetRes = new GoAheadSetRes(); objGoAheadSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("Handover:SendMailHandoverBooking"), goAheadGetReq, typeof(GoAheadSetRes), ticket); return(objGoAheadSetRes); }
public async Task <GoAheadSetRes> SetGoAhead(GoAheadSetReq goAheadSetReq, string ticket) { GoAheadSetRes goAheadSetRes = new GoAheadSetRes(); goAheadSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("Handover:SetGoAhead"), goAheadSetReq, typeof(GoAheadSetRes), ticket); return(goAheadSetRes); }
public GoAheadSetRes SendMailHandoverBooking(GoAheadGetReq request, string token) { GoAheadSetRes objGoAheadSetRes = new GoAheadSetRes(); try { objGoAheadSetRes = handoverProviders.SendMailHandoverBooking(request, token).Result; objGoAheadSetRes = objGoAheadSetRes != null ? objGoAheadSetRes : new GoAheadSetRes(); } catch (Exception ex) { Console.WriteLine(ex.Message); } return(objGoAheadSetRes); }
public IActionResult SetAttachToMaster(AttachToMasterViewModel model) { model.GoAheadGetRes.mGoAhead.CreateUser = ckUserName; model.GoAheadGetRes.mGoAhead.EditUser = ckUserName; string type = model.Type; GoAheadSetRes objGoAheadSetRes = handoverMapping.SetGoAhead(model, ckUserEmailId, token, ckLoginUser_Id); if (!string.IsNullOrEmpty(model.Type) && type == "partial") { return(Json(new { status = objGoAheadSetRes.ResponseStatus.Status, msg = objGoAheadSetRes.ResponseStatus.ErrorMessage, goaheadid = objGoAheadSetRes.mGoAhead.GoAheadId })); //objGoAheadSetRes.mGoAhead.Depatures = null; //objGoAheadSetRes.mGoAhead.Depatures.Add(depres); //return PartialView("_Materialisation", objGoAheadSetRes.mGoAhead); } else { if (objGoAheadSetRes != null && objGoAheadSetRes.ResponseStatus != null && objGoAheadSetRes.ResponseStatus.Status.ToLower() == "success") { //GoAheadSetRes objGoAheadSetResMail = handoverMapping.SendMailHandoverBooking(new GoAheadGetReq { GoAheadId = model.GoAheadGetRes.mGoAhead.GoAheadId, QRFID = model.GoAheadGetRes.mGoAhead.QRFID }, token); TempData["success"] = objGoAheadSetRes.ResponseStatus.ErrorMessage; } else { TempData["error"] = objGoAheadSetRes.ResponseStatus.ErrorMessage; } //var Status = ""; //var Msg = ""; //if (objGoAheadSetResMail != null && objGoAheadSetResMail.ResponseStatus != null) //{ // Status = objGoAheadSetResMail.ResponseStatus.Status; // Msg = objGoAheadSetResMail.ResponseStatus.ErrorMessage; //} //else //{ // Status = "Error"; // Msg = "An Error Occurs."; //} return(RedirectToAction("AttachToMaster", new { QRFId = model.GoAheadGetRes.mGoAhead.QRFID })); } }
public GoAheadSetRes SetGoAhead(AttachToMasterViewModel model, string userEmail, string token, string voyagerUserId) { GoAheadSetRes objGoAheadSetRes = new GoAheadSetRes(); GoAheadSetReq objGoAheadSetReq = new GoAheadSetReq { mGoAhead = model.GoAheadGetRes.mGoAhead, DepatureId = model.DepartureId }; try { objGoAheadSetReq.mGoAhead.OperationUserID = model.UserID; objGoAheadSetReq.mGoAhead.OperationUserName = model.UserName; objGoAheadSetReq.mGoAhead.QRFID = model.MenuViewModel.QRFID; if (!string.IsNullOrEmpty(model.ConfirmationDT)) { var dt = model.ConfirmationDT.Split("/"); if (dt?.Count() >= 3) { DateTime fromDT = new DateTime(Convert.ToInt32(dt[2]), Convert.ToInt32(dt[1]), Convert.ToInt32(dt[0])); objGoAheadSetReq.mGoAhead.ConfirmationDeadline = fromDT; } else { objGoAheadSetReq.mGoAhead.ConfirmationDeadline = null; } } objGoAheadSetReq.mGoAhead.QRFPriceId = model.QRFPriceId; objGoAheadSetReq.mGoAhead.VersionId = model.VersionId; objGoAheadSetReq.UserEmail = userEmail; objGoAheadSetReq.VoyagerUserId = voyagerUserId; objGoAheadSetRes = handoverProviders.SetGoAhead(objGoAheadSetReq, token).Result; objGoAheadSetRes = objGoAheadSetRes != null ? objGoAheadSetRes : new GoAheadSetRes(); } catch (Exception ex) { Console.WriteLine(ex.Message); } return(objGoAheadSetRes); }