public IActionResult SalesDashboard() { SalesDashboardViewModel model = new SalesDashboardViewModel(); try { #region Bind Dropdown Data var AgentRes = objMISProviders.GetSalesDashboardFiltersList(new AgentCompanyReq { AgentName = "", CompanyId = ckUserCompanyId, UserId = ckLoginUser_Id, SpecificFilterName = "ALL", Roles = UserRoles }, token).Result; //model.SalesDashboardFilters.MISMapping = AgentRes.MISMappingList; model.SalesDashboardFilters.SalesOfficeList = AgentRes.SalesOfficeList; model.SalesDashboardFilters.SalesPersonList = AgentRes.SalesPersonList; model.SalesDashboardFilters.AgentNameList = AgentRes.AgentList.Select(a => new AttributeValues { AttributeValue_Id = a.VoyagerCompany_Id, Value = a.Name }).ToList(); var DestinationRes = salesLibrary.BindMasterData(_configuration, token, "QRF Destination"); model.SalesDashboardFilters.DestinationList = DestinationRes.DestinationList; #endregion } catch (Exception ex) { Console.WriteLine(ex.Message); } return(View(model)); }
public IActionResult ViewTaxRegDetails(string CompanyId, string TaxRegId) { TaxRegDetails model = new TaxRegDetails(); requestForTaxReg = new TaxRegestrationDetails_Req(); responseForTaxReg = new TaxRegestrationDetails_Res(); requestForTaxReg.Company_Id = CompanyId; requestForTaxReg.TaxReg_Id = TaxRegId; responseForTaxReg = supplierProviders.GetTaxRegDetails(requestForTaxReg, token).Result; model.Company_Id = CompanyId; #region Get currency list QuoteSearchViewModel modelMasterForTaxRgStatus = new QuoteSearchViewModel(); modelMasterForTaxRgStatus = TaxTypeLibrary.BindMasterData(_configuration, token, "TaxRgStatus"); QuoteSearchViewModel modelMasterForTaxRgType = new QuoteSearchViewModel(); modelMasterForTaxRgType = TaxTypeLibrary.BindMasterData(_configuration, token, "TaxRgType"); model.TaxRegStatus = modelMasterForTaxRgStatus.TaxRgStatusList; model.TaxRegType = modelMasterForTaxRgType.TaxRgTypeList; SalesProviders objSalesProvider = new SalesProviders(_configuration); var objAgentResponse = agentProviders.GetSystemCompanyDetails(ckUserContactId, token).Result; AgentGetReq request = new AgentGetReq(); request.CompanyId = objAgentResponse.SystemCompanyId; request.UserId = ckLoginUser_Id; AgentGetRes responseForCompany = new AgentGetRes(); responseForCompany = agentProviders.GetAgentDetails(request, token).Result; List <Attributes> stateList = masterProviders.GetAllStatesByCountryId(responseForCompany.AgentList.FirstOrDefault()?.CountryId, token).Result; model.States = stateList; #endregion if (responseForTaxReg != null && !string.IsNullOrEmpty(TaxRegId)) { var TaxRegDetails = responseForTaxReg.TaxRegestrationDetails.Where(x => x.TaxReg_Id == TaxRegId).FirstOrDefault(); model.TaxReg_Id = TaxRegDetails.TaxReg_Id; model.State = TaxRegDetails.State; model.State_Id = TaxRegDetails.State_Id; model.Number = TaxRegDetails.Number; model.Status = TaxRegDetails.Status; model.Type = TaxRegDetails.Type; model.TaxStatus = TaxRegDetails.TaxStatus; model.Type_Id = TaxRegDetails.Type_Id; model.TaxStatus_Id = TaxRegDetails.Taxstatus_Id; model.Company_Id = TaxRegDetails.Company_id; } return(PartialView("ViewTaxRegDetails", model)); }
public IActionResult Quote() { QuoteSearchViewModel model = new QuoteSearchViewModel(); SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration); model = quoteLibrary.BindMasterData(_configuration, token); ViewBag.SearchResult = false; return(View(model)); }
public IActionResult Quote(QuoteSearchViewModel model) { SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration); QuoteSearchViewModel modelMaster = new QuoteSearchViewModel(); modelMaster = quoteLibrary.BindMasterData(_configuration, token); model.PipelineStagesList = modelMaster.PipelineStagesList; model.QuotePriorityList = modelMaster.QuotePriorityList; model.QuoteResultList = modelMaster.QuoteResultList; model.QuoteStatusList = modelMaster.QuoteStatusList; model.DateTypeList = modelMaster.DateTypeList; model.MonthList = modelMaster.MonthList; model.YearList = modelMaster.YearList; model.DivisionList = modelMaster.DivisionList; model.DestinationList = modelMaster.DestinationList; QuoteSearchReq objQuoteSearchReq = new QuoteSearchReq(); objQuoteSearchReq.CurrentPipeline = model.PipelineStages; objQuoteSearchReq.AgentName = model.AgentName; objQuoteSearchReq.QRFID = model.CNKReferenceNo; objQuoteSearchReq.TourCode = model.AgentReferenceNo; objQuoteSearchReq.TourName = model.AgentTour; objQuoteSearchReq.QRFStatus = model.QuoteStatus; objQuoteSearchReq.QuoteResult = model.QuoteResult; objQuoteSearchReq.Priority = model.QuotePriority; objQuoteSearchReq.Date = model.DateType; objQuoteSearchReq.Division = model.Division; objQuoteSearchReq.Destination = model.Destination; objQuoteSearchReq.UserId = ckLoginUser_Id; if (string.IsNullOrEmpty(model.From)) { objQuoteSearchReq.From = null; } else { var strFromDT = model.From.Split("/"); if (strFromDT?.Count() >= 3) { DateTime fromDT = new DateTime(Convert.ToInt32(strFromDT[2]), Convert.ToInt32(strFromDT[1]), Convert.ToInt32(strFromDT[0])); objQuoteSearchReq.From = fromDT; } else { objQuoteSearchReq.From = null; } } if (string.IsNullOrEmpty(model.To)) { objQuoteSearchReq.To = null; } else { var strToDT = model.To.Split("/"); if (strToDT?.Count() >= 3) { DateTime toDT = new DateTime(Convert.ToInt32(strToDT[2]), Convert.ToInt32(strToDT[1]), Convert.ToInt32(strToDT[0])); objQuoteSearchReq.To = toDT; } else { objQuoteSearchReq.To = null; } } objQuoteSearchReq.Month = model.Month; objQuoteSearchReq.Year = Convert.ToInt16(model.Year); SalesProviders objSalesProvider = new SalesProviders(_configuration); QuoteSearchRes objQuoteSearchRes = objSalesProvider.GetQRFEnquiryPipelineList(objQuoteSearchReq, token).Result; model.EnquiryPipeline = new EnquiryPipelineViewModel(); model.EnquiryPipeline.QuoteSearchDetails = objQuoteSearchRes.QuoteSearchDetails; if (model.EnquiryPipeline.QuoteSearchDetails != null) { foreach (var i in model.EnquiryPipeline.QuoteSearchDetails) { if (i.AgentPassengerInfo == null) { i.AgentPassengerInfo = new AgentPassengerInfo(); } if (i.FollowUpItem == null) { i.FollowUpItem = new FollowUpItem(); } } } model.EnquiryPipeline.Status = objQuoteSearchRes.ResponseStatus.Status; model.EnquiryPipeline.TotalCount = objQuoteSearchRes.TotalCount; ViewBag.PipelineStages = model.PipelineStages; ViewBag.SearchResult = true; ViewBag.IsAllowToEdit = false; if (model.PipelineStages == "Quote Pipeline" || model.PipelineStages == "Agent Approval Pipeline" || model.PipelineStages == "Amendment Pipeline" || model.PipelineStages == "Handover Pipeline") { if (UserRoles.Contains("Sales Officer")) { ViewBag.IsAllowToEdit = true; } } else if (model.PipelineStages == "Costing Pipeline") { if (UserRoles.Contains("Costing Officer")) { ViewBag.IsAllowToEdit = true; } } else if (model.PipelineStages == "Costing Approval Pipeline") { if (UserRoles.Contains("Product Accountant")) { ViewBag.IsAllowToEdit = true; } } return(View(model)); }