public AttachToMasterViewModel GetGoAhead(string token, GoAheadGetReq objGoAheadGetReq) { AttachToMasterViewModel model = new AttachToMasterViewModel(); GoAheadGetRes objGoAheadGetRes = new GoAheadGetRes(); try { model = GetSalesOfficerHeraderInfo(objGoAheadGetReq.QRFID, "AttachToMaster", token); objGoAheadGetRes = handoverProviders.GetGoAhead(objGoAheadGetReq, token).Result; if (objGoAheadGetRes != null) { model.GoAheadGetRes = objGoAheadGetRes; model.UserList = objGoAheadGetRes.UserSystemContactDetails.Select(a => new AttributeValues { AttributeValue_Id = a.VoygerContactId, Value = a.FirstName + " " + a.LastName, Flag = a.IsOperationDefault }).OrderBy(a => a.Value).ToList(); model.UserID = string.IsNullOrEmpty(objGoAheadGetRes.mGoAhead.OperationUserID) ? model.UserList.Where(a => a.Flag == true).FirstOrDefault().AttributeValue_Id : objGoAheadGetRes.mGoAhead.OperationUserID; model.UserName = string.IsNullOrEmpty(objGoAheadGetRes.mGoAhead.OperationUserName) ? model.UserList.Where(a => a.Flag == true).FirstOrDefault().Value : objGoAheadGetRes.mGoAhead.OperationUserName; CostsheetVersion objCostsheetVersion = objGoAheadGetRes.CostsheetVersion.Where(a => a.IsCurrentVersion == true).FirstOrDefault(); if (objCostsheetVersion != null) { model.VersionId = objCostsheetVersion.VersionId; model.QRFPriceId = objCostsheetVersion.QRFPriceId; } if (objGoAheadGetRes.mGoAhead.ConfirmationDeadline != null) { var dt = objGoAheadGetRes.mGoAhead.ConfirmationDeadline.Value; var day = dt.Day.ToString().Length == 1 ? "0" + dt.Day.ToString() : dt.Day.ToString(); var month = dt.Month.ToString().Length == 1 ? "0" + dt.Month.ToString() : dt.Month.ToString(); model.ConfirmationDT = day + "/" + month + "/" + dt.Year; } else { model.ConfirmationDT = null; } } else { objGoAheadGetRes = new GoAheadGetRes(); model.GoAheadGetRes = objGoAheadGetRes; model.UserList = new List <AttributeValues>(); model.UserID = ""; model.UserName = ""; model.VersionId = 0; model.QRFPriceId = ""; model.ConfirmationDT = null; } } catch (Exception ex) { objGoAheadGetRes = new GoAheadGetRes(); model.GoAheadGetRes = objGoAheadGetRes; model.UserList = new List <AttributeValues>(); model.UserID = ""; model.UserName = ""; model.VersionId = 0; model.QRFPriceId = ""; model.ConfirmationDT = null; } return(model); }
public async Task <GoAheadGetRes> GetGoAhead(GoAheadGetReq goAheadGetReq, string ticket) { GoAheadGetRes goAheadGetRes = new GoAheadGetRes(); goAheadGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("Handover:GetGoAhead"), goAheadGetReq, typeof(GoAheadGetRes), ticket); return(goAheadGetRes); }
public async Task <GoAheadGetRes> GetGoAhead([FromBody] GoAheadGetReq request) { var response = new GoAheadGetRes(); try { if (!string.IsNullOrEmpty(request?.QRFID)) { response = await _handoverRepository.GetGoAhead(request); } else { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "QRF ID can not be Null/Zero."; } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message; } return(response); }
public AttachToMasterViewModel() { COHeaderViewModel = new COHeaderViewModel(); MenuViewModel = new MenuViewModel(); GoAheadGetRes = new GoAheadGetRes(); }