예제 #1
0
        public async Task <OpsBookingSummaryGetRes> GetOpsBookingSummary([FromBody] ProductSRPHotelGetReq request)
        {
            var response = new OpsBookingSummaryGetRes();

            try
            {
                if (request != null)
                {
                    response = await _opsRepository.GetOpsBookingSummary(request);

                    if (response == null)
                    {
                        response.ResponseStatus.Status       = "Failure";
                        response.ResponseStatus.ErrorMessage = "An error.";
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Product details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message;
            }
            return(response);
        }
예제 #2
0
        public async Task <OpsBookingSummaryGetRes> GetOpsBookingSummary(ProductSRPHotelGetReq productSearchReq, string ticket)
        {
            OpsBookingSummaryGetRes productHotelGetRes = new OpsBookingSummaryGetRes();

            productHotelGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceOperations:GetOpsBookingSummary"), productSearchReq, typeof(OpsBookingSummaryGetRes), ticket);

            return(productHotelGetRes);
        }
예제 #3
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());
            }
        }