Ejemplo n.º 1
0
        public async Task <CompanyOfficerGetRes> GetCompanyContacts(CompanyOfficerGetReq companyOfficerGetReq, string ticket)
        {
            CompanyOfficerGetRes companyOfficerGetRes = new CompanyOfficerGetRes();

            companyOfficerGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("AgentService:GetCompanyContacts"), companyOfficerGetReq, typeof(CompanyOfficerGetRes), ticket);

            return(companyOfficerGetRes);
        }
Ejemplo n.º 2
0
        public IActionResult Proposal()
        {
            string QRFID     = Request.Query["QRFId"];
            bool   GetStatus = false;

            ProposalViewModel model = new ProposalViewModel();

            model.MenuViewModel.QRFID    = QRFID;
            model.MenuViewModel.MenuName = "Proposal";
            model.CurrentDate            = DateTime.Now.ToString("dd MMM yyyy");
            string username = "";

            username       = HttpContext.Request.Cookies["UserName"] ?? ckUserName;
            model.UserName = username;

            #region Get Costing Officer Tour Info Header By QRFId
            NewQuoteViewModel modelQuote = new NewQuoteViewModel();
            modelQuote.QRFID                    = QRFID;
            model.COHeaderViewModel             = cOCommonLibrary.GetCOTourInfoHeader(ref modelQuote, token);
            model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
            #endregion

            ProposalLibrary proposalLibrary = new ProposalLibrary(_configuration);

            CompanyOfficerGetRes officerGetRes = new CompanyOfficerGetRes();
            CompanyOfficerGetReq officerGetReq = new CompanyOfficerGetReq();
            officerGetReq.CompanyId = ckUserCompanyId;
            officerGetReq.UserRole  = "Product Accountant";
            officerGetRes           = agentProviders.GetCompanyOfficers(officerGetReq, token).Result;

            model.OfficerList = officerGetRes.ContactDetails;
            var salespipelineres = agentProviders.GetAutomatedSalesPipelineRoles(new SettingsAutomatedGetReq {
                CompanyId = ckUserCompanyId, QRFId = QRFID, UserRole = officerGetReq.UserRole
            }, token).Result;
            if (!string.IsNullOrEmpty(salespipelineres?.ResponseStatus?.Status))
            {
                model.Officer = salespipelineres.UserEmailId;
            }
            #region PriceBreakUp
            if (!string.IsNullOrEmpty(QRFID))
            {
                model.QRFID = QRFID;
                GetStatus   = proposalLibrary.GetProposalPriceBreakupByQRFId(_configuration, token, ref model, QRFID);
            }

            ProposalGetReq request  = new ProposalGetReq();
            ProposalGetRes response = new ProposalGetRes();
            request.QRFID = QRFID;
            response      = coProviders.GetProposal(request, token).Result;
            if (response != null)
            {
                model.ProposalId = response.Proposal.ProposalId;
                model.ProposalPriceBreakupViewModel.PriceBreakUp = response.Proposal.PriceBreakup;
            }

            #endregion
            return(View(model));
        }
Ejemplo n.º 3
0
        public IActionResult QRFSummary(string filterByDay = null, string filterByServiceType = null)
        {
            try
            {
                string QRFID = Request.Query["QRFId"];
                QRFSummaryViewModel model = new QRFSummaryViewModel();
                model.QRFID = QRFID;
                model.MenuViewModel.QRFID    = QRFID;
                model.MenuViewModel.MenuName = "Summary";
                model.CurrentDate            = DateTime.Now.ToString("dd MMM yyyy");
                bool   GetStatus = false;
                string username  = "";
                IRequestCookieCollection objCookies = HttpContext.Request.Cookies;
                objCookies.TryGetValue("UserName", out username);
                username       = string.IsNullOrEmpty(username) ? ckUserName : username;
                model.UserName = username;
                #region Get Quote Info By QRFId
                NewQuoteViewModel modelQuote = new NewQuoteViewModel();
                modelQuote.QRFID = QRFID;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
                }

                CompanyOfficerGetRes officerGetRes = new CompanyOfficerGetRes();
                CompanyOfficerGetReq officerGetReq = new CompanyOfficerGetReq();
                officerGetReq.CompanyId = ckUserCompanyId;
                officerGetReq.UserRole  = "Costing Officer";
                officerGetRes           = agentProviders.GetCompanyOfficers(officerGetReq, token).Result;

                model.OfficerList = officerGetRes.ContactDetails;
                var salespipelineres = agentProviders.GetAutomatedSalesPipelineRoles(new SettingsAutomatedGetReq {
                    CompanyId = ckUserCompanyId, QRFId = QRFID, UserRole = officerGetReq.UserRole
                }, token).Result;
                if (!string.IsNullOrEmpty(salespipelineres?.ResponseStatus?.Status))
                {
                    model.Officer = salespipelineres.UserEmailId;
                }
                #endregion
                return(View(model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 4
0
        public IActionResult ViewIntegrationCredentials(IntegartionCredentailsViewModel model)
        {
            CompanyOfficerGetReq        officerGetReq = new CompanyOfficerGetReq();
            Integration_Search_Request  request       = new Integration_Search_Request();
            Integration_Search_Response response      = new Integration_Search_Response();

            officerGetReq.CompanyId = ckUserCompanyId;

            var officerGetRes = agentProviders.GetCompanyContacts(officerGetReq, token).Result;

            model.ContactPersonList = officerGetRes.ContactDetails.Where(a => a.Systemuser_id != null).ToList();

            model.ApplicationList = userAndRoleMgmtProviders.GetApplicationAttributes(request, token).Result.Application_DataList;

            model.ContactPersonList.ForEach(a => a.FIRSTNAME = a.CommonTitle + " " + a.FIRSTNAME + " " + a.LastNAME);

            return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewIntegrationCredentials.cshtml", model));
        }
Ejemplo n.º 5
0
        public async Task <CompanyOfficerGetRes> GetCompanyContacts([FromBody] CompanyOfficerGetReq request)
        {
            var response = new CompanyOfficerGetRes();

            try
            {
                if (!string.IsNullOrEmpty(request.CompanyId))
                {
                    response = await _agentRepository.GetCompanyContacts(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "CompanyId can not be Null/Empty.";
                }
            }
            catch (Exception ex)
            {
                response = null;
            }
            return(response);
        }
Ejemplo n.º 6
0
        public IActionResult GetUsersByRole(string SalesPerson, string CostingOfficer, string ProdAccountant, string FileHandler, string QRFID, string ModuleName, string BookingNumber)
        {
            try
            {
                UserDetailsViewModel model    = new UserDetailsViewModel();
                UserByRoleGetRes     response = new UserByRoleGetRes();
                UserByRoleGetReq     request  = new UserByRoleGetReq();
                request.RoleName = new List <string>()
                {
                    "Sales Officer", "Costing Officer", "Product Accountant", "Groups", "Operations_Management"
                };

                response = loginProviders.GetUsersByRole(request, token).Result;

                model.SalesOfficerList      = response.Users.Where(a => a.UserRole == "Sales Officer").ToList();
                model.CostingOfficerList    = response.Users.Where(a => a.UserRole == "Costing Officer").ToList();
                model.ProductAccountantList = response.Users.Where(a => a.UserRole == "Product Accountant").ToList();
                //model.FileHandlerList = response.Users.Where(a => a.UserRole == "Groups" || a.UserRole == "Operations_Management").Distinct().ToList();
                //model.FileHandlerList.ForEach(a => { a.UserRole = ""; a.UserRoleId = ""; });
                //model.FileHandlerList = model.FileHandlerList.Distinct().ToList();

                var FileHandlerList = response.Users.Where(a => a.UserRole == "Groups" || a.UserRole == "Operations_Management").Select(a => a.Email).Distinct().ToList();
                FileHandlerList.ForEach(a => model.FileHandlerList.Add(new UserDetails()
                {
                    Email = a
                }));

                model.SalesOfficer      = SalesPerson;
                model.CostingOfficer    = CostingOfficer;
                model.ProductAccountant = ProdAccountant;
                model.FileHandler       = FileHandler;

                CompanyOfficerGetRes officerGetRes = new CompanyOfficerGetRes();
                CompanyOfficerGetReq officerGetReq = new CompanyOfficerGetReq();
                if (ModuleName == "ops")
                {
                    ProductSRPHotelGetReq BookingReq = new ProductSRPHotelGetReq()
                    {
                        QRFID = BookingNumber
                    };
                    OpsBookingSummaryGetRes BookingRes = operationsProviders.GetOpsBookingSummary(BookingReq, token).Result;
                    if (BookingRes != null)
                    {
                        model.ContactPersonID   = BookingRes.OpsBookingSummaryDetails.ContactId;
                        model.EmailAddress      = BookingRes.OpsBookingSummaryDetails.ContactEmail;
                        model.MobileNo          = BookingRes.OpsBookingSummaryDetails.ContactTel;
                        officerGetReq.CompanyId = BookingRes.OpsBookingSummaryDetails.AgentId;
                    }
                }
                else
                {
                    NewQuoteViewModel quoteModel = new NewQuoteViewModel();
                    quoteModel.QRFID = QRFID;
                    cOCommonLibrary.GetCOTourInfoHeader(ref quoteModel, token);
                    model.ContactPersonID   = quoteModel.COHeaderViewModel.ContactPersonID;
                    model.EmailAddress      = quoteModel.COHeaderViewModel.EmailAddress;
                    model.MobileNo          = quoteModel.COHeaderViewModel.MobileNo;
                    officerGetReq.CompanyId = quoteModel.COHeaderViewModel.AgentID;
                }

                officerGetReq.UserRole  = "";
                officerGetRes           = agentProviders.GetCompanyContacts(officerGetReq, token).Result;
                model.ContactPersonList = officerGetRes.ContactDetails;
                model.ContactPersonList.ForEach(a => a.FIRSTNAME = a.CommonTitle + " " + a.FIRSTNAME + " " + a.LastNAME);

                return(PartialView("_ChangeUserForQuote", model));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }