public PartialViewResult NotimationsPartials(string partial, string clickedRow, string popUpFor, string pipelineDuns) { NominationPartialDTO model = new NominationPartialDTO(); string partialView = string.Empty; model.ForRow = clickedRow; var currentidentity = GetValueFromIdentity(); int companyId = int.Parse(currentidentity.CompanyId ?? "0"); model.PopUpFor = popUpFor; model.PipelineDuns = pipelineDuns; if (partial.ToLower() == "locations") { List <LocationsDTO> locationList = new List <LocationsDTO>(); model.Locations = new List <LocationsDTO>(); // var Pipelineduns = pipelineService.GetDunsByPipelineID(PipelineID); // locationList = IPNTNominationService.GetLocations(string.Empty, Pipelineduns, 1, 1000, string.Empty).ToList(); //if (popUpFor == "ContractPath" || popUpFor == "Supply" ||popUpFor== "Receipt") //{ // model.Locations = locationList.Where(a => (a.RDB == "R" || a.RDB == "B")).ToList(); //} //else if (popUpFor == "DelContractPath" || popUpFor == "Market"|| popUpFor == "Delivery") //{ // model.Locations = locationList.Where(a => (a.RDB == "D" || a.RDB == "B")).ToList(); //} ViewBag.IsSpecialDelCase = false; ViewBag.PopUpFor = popUpFor; partialView = "~/Views/PNTNominations/_LocationPopUp.cshtml"; } else if (partial == "TransactionType") { model.TransactionTypes = new List <TransactionTypesDTO>(); model.TransactionTypes = IPNTNominationService.GetTransactionsTypes(pipelineDuns, "", model.PopUpFor).ToList(); model.TransactionTypes = model.TransactionTypes.OrderBy(a => Convert.ToInt32(a.Identifier)).ToList(); partialView = "~/Views/PNTNominations/_TransactionTypePopUp.cshtml"; } else if (partial == "CounterParties") { model.CounterParties = new List <CounterPartiesDTO>(); partialView = "~/Views/PNTNominations/_CounterPartyPopUp.cshtml"; } else if (partial == "Contract") { model.Contracts = new List <ContractsDTO>(); model.Contracts = IPNTNominationService.GetContracts(companyId, pipelineDuns).ToList(); model.PipelineDuns = pipelineDuns; partialView = "~/Views/PNTNominations/_ContractPopUp.cshtml"; } else if (partial == "StatusReason") { var transactionId = popUpFor; model.StatusReason = IPNTNominationService.GetRejectionReason(Guid.Parse(transactionId)).ToList(); partialView = "~/Views/PNTNominations/_StatusReasonPopUp.cshtml"; } return(PartialView(partialView, model)); }
public PartialViewResult NotimationsPartials(string partial, string popUpFor) { NominationPartialDTO model = new NominationPartialDTO(); //int companyId = Convert.ToInt32(Session["ShipperCompanyId"]); var identity = (ClaimsPrincipal)Thread.CurrentPrincipal; string company = identity.Claims.Where(c => c.Type == "CompanyId") .Select(c => c.Value).SingleOrDefault(); int companyID = String.IsNullOrEmpty(company) ? 0:int.Parse(company); string partialView = string.Empty; model.PopUpFor = popUpFor; if (partial == "StatusReason") { var transactionId = popUpFor; model.StatusReason = pntNominationService.GetRejectionReason(Guid.Parse(transactionId)).ToList(); partialView = "~/Views/PNTNominations/_StatusReasonPopUp.cshtml"; } return(PartialView(partialView, model)); }