예제 #1
0
        public async Task <CompanyOfficerGetRes> GetSalesOfficesByCompanyId(string CompanyId, string ticket)
        {
            CompanyOfficerGetRes companyOfficerGetRes = new CompanyOfficerGetRes();

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

            return(companyOfficerGetRes);
        }
예제 #2
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);
        }
예제 #3
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));
        }
예제 #4
0
        public async Task <CompanyOfficerGetRes> GetSalesOfficesByCompanyId([FromBody] string CompanyId)
        {
            var response = new CompanyOfficerGetRes();

            try
            {
                response = await _agentRepository.GetSalesOfficesByCompanyId(CompanyId);
            }
            catch (Exception ex)
            {
                response = null;
            }
            return(response);
        }
예제 #5
0
        public async Task <CompanyOfficerGetRes> GetSalesOfficesOfSystemCompany()
        {
            var response = new CompanyOfficerGetRes();

            try
            {
                response = await _agentRepository.GetSalesOfficesOfSystemCompany();
            }
            catch (Exception ex)
            {
                response = null;
            }
            return(response);
        }
예제 #6
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;
            }
        }
예제 #7
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);
        }
예제 #8
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());
            }
        }
        public IActionResult ViewSalesPipelineRoles(string tabName)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(tabName))
                {
                    ViewBag.tabName = tabName;
                }

                SalesPipelineViewModel model = new SalesPipelineViewModel();

                #region Destination dropdown binding
                MasterTypeRequest objMasterTypeRequest = new MasterTypeRequest();
                objMasterTypeRequest.Property = "QRF Masters";
                objMasterTypeRequest.Name     = "QRF Destination";
                SalesProviders     objSalesProvider      = new SalesProviders(_configuration);
                MasterTypeResponse objMasterTypeResponse = objSalesProvider.GetGenericMasterForType(objMasterTypeRequest, token).Result;

                model.DestinationList = objMasterTypeResponse.PropertyList[0].Attribute[0].Values.Select(a => new AttributeValues
                {
                    AttributeValue_Id = a.AttributeValue_Id,
                    CityName          = a.Value.Contains("|") ? a.Value.Split("|")[0].Trim() : "",
                    Value             = a.Value.Contains("|") ? a.Value.Split("|")[1].Trim() : a.Value
                }).ToList();
                #endregion

                #region Role dropdown binding
                UserByRoleGetRes response = new UserByRoleGetRes();
                UserByRoleGetReq request  = new UserByRoleGetReq();
                request.RoleName = new List <string>()
                {
                    "Costing Officer", "Product Accountant"
                };
                response       = loginProviders.GetRoleIdByRoleName(request, token).Result;
                model.RoleList = response.Users.Select(x => new AttributeValues {
                    AttributeValue_Id = x.UserRoleId, Value = x.UserRole
                }).ToList();
                #endregion

                #region Sales Office dropdown binding
                CompanyOfficerGetRes res = new CompanyOfficerGetRes();
                res = agentProviders.GetSalesOfficesOfSystemCompany(token).Result;
                model.SalesOfficeList = res.Branches.Select(x => new AttributeValues {
                    AttributeValue_Id = x.Company_Id, Value = x.Company_Name
                }).ToList();
                #endregion

                #region Destination list binding
                SettingsGetReq request1  = new SettingsGetReq();
                SettingsGetRes response1 = new SettingsGetRes();
                request1.Type = "Destination";
                request1.LoggedInUserContact_Id = ckUserContactId;
                response1 = userAndRoleMgmtProviders.GetSalesPipelineRoles(request1, token).Result;
                model.RolesByDestinationList = response1.Values.ToList();
                model.RolesByDestinationList.Add(new Values());
                #endregion

                #region Sales office list binding
                SettingsGetReq request2  = new SettingsGetReq();
                SettingsGetRes response2 = new SettingsGetRes();
                request2.Type = "SalesOffice";
                request2.LoggedInUserContact_Id = ckUserContactId;
                response2 = userAndRoleMgmtProviders.GetSalesPipelineRoles(request2, token).Result;
                model.RolesBySalesOfficeList = response2.Values.ToList();
                model.RolesBySalesOfficeList.Add(new Values());
                #endregion

                return(PartialView("~/Areas/Settings/Views/UserAndRoleMgmt/_ViewSalesPipelineRoles.cshtml", model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }