示例#1
0
        public IActionResult GetFOC(string QRFID)
        {
            NewQuoteViewModel model = new NewQuoteViewModel();

            try
            {
                bool GetStatus = false;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                if (!string.IsNullOrEmpty(QRFID))
                {
                    model.QRFID = QRFID;
                    model.mdlQuoteFOCViewModel.QRFID       = QRFID;
                    model.mdlQuoteFOCViewModel.StandardFoc = true;
                    GetStatus = quoteLibrary.GetFOCDetails(_configuration, token, ref model);
                    if (model.mdlQuoteFOCViewModel.QuoteFOCDetails != null && model.mdlQuoteFOCViewModel.QuoteFOCDetails.Count < 1)
                    {
                        model.mdlQuoteFOCViewModel.QuoteFOCDetails.Add(new QuoteFOCDetails {
                            DateRange = "ALL", PaxSlab = "ALL", FOCSingle = 0, FOCTwin = 0, FOCDouble = 0, FOCTriple = 0
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(PartialView("_QuoteFOC", model.mdlQuoteFOCViewModel));
        }
示例#2
0
 public IActionResult QuoteDateRange(QuoteDateRangeViewModel model)
 {
     try
     {
         SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
         if (ModelState.IsValid)
         {
             IRequestCookieCollection objCookies = HttpContext.Request.Cookies;
             var sessionData = string.IsNullOrEmpty(HttpContext.Request.Cookies["VoyagerUser_Id"]) ? HttpContext.Session.GetComplexData <List <ProductAttributeDetails> >(SessionName) : null;
             model.QuoteSpecificDateViewModel = model.QuoteSpecificDateViewModel.Where(a => a.DepartureId > 0 || (a.DepartureId == 0 && a.IsDeleted == false)).ToList();
             DepartureDateSetResponse departureSetResponse = quoteLibrary.SetQRFDepartureDetails(_configuration, token, model, objCookies, sessionData);
             if (departureSetResponse.Status.ToLower() == "success")
             {
                 TempData["success"] = "Departure Dates saved successfully";
             }
             else
             {
                 TempData["error"] = departureSetResponse.Status;
             }
         }
         return(RedirectToAction("GetDateRange", new { model.QRFID }));
     }
     catch (Exception ex)
     {
         throw;
         return(RedirectToAction("GetDateRange", new { model.QRFID }));
     }
 }
示例#3
0
        public IActionResult QuotePaxRange(QuotePaxRangeViewModel model)
        {
            try
            {
                SalesQuoteLibrary        quoteLibrary = new SalesQuoteLibrary(_configuration);
                IRequestCookieCollection objCookies   = HttpContext.Request.Cookies;
                var sessionData = string.IsNullOrEmpty(HttpContext.Request.Cookies["VoyagerUser_Id"]) ? HttpContext.Session.GetComplexData <List <ProductAttributeDetails> >(SessionName) : null;
                //if (ModelState.IsValid)
                //{
                model.QuotePaxSlabDetails = model.QuotePaxSlabDetails.Where(a => a.PaxSlabId > 0 || (a.PaxSlabId == 0 && a.IsDeleted == false)).ToList();
                if (model.HotelsOption != "yes")
                {
                    model.HotelCategoryList = null; model.HotelChainList = null;
                }

                PaxSetResponse departureSetResponse = quoteLibrary.SetPaxRangeDetails(_configuration, token, model, objCookies, sessionData);
                if (departureSetResponse.Status.ToLower() == "success")
                {
                    TempData["success"] = "Pax details saved successfully";
                }
                else
                {
                    TempData["error"] = departureSetResponse.Status;
                }
                //}
                return(RedirectToAction("GetPaxRange", new { model.QRFID }));
            }
            catch (Exception ex)
            {
                throw;
                TempData["error"] = ex.Message;
                return(RedirectToAction("GetPaxRange", new { model.QRFID }));
            }
        }
示例#4
0
        public JsonResult GetProductRangeList(string QRFId, string ProductId, string CategoryId, string AdditionalYN)
        {
            SalesQuoteLibrary  quoteLibrary    = new SalesQuoteLibrary(_configuration);
            ProductRangeGetRes prodRangeGetRes = quoteLibrary.GetProductRangeList(ProductId, CategoryId, AdditionalYN, token, string.IsNullOrEmpty(QRFId) ? "" : QRFId);

            List <AutoCompleteTextBox> prodRangeList    = new List <AutoCompleteTextBox>();
            List <AutoCompleteTextBox> defProdRangeList = new List <AutoCompleteTextBox>();

            if (prodRangeGetRes.ResponseStatus.Status.ToLower() == "success" && prodRangeGetRes.ProductRangeDetails.Count > 0)
            {
                prodRangeList = prodRangeGetRes.ProductRangeDetails.Select(a => new AutoCompleteTextBox {
                    value = a.VoyagerProductRange_Id, label = a.ProductRangeCode + " (" + a.PersonType + (a.AgeRange == null ? "" : " | " + a.AgeRange) + ")", type = a.AdditionalYN.ToString()
                }).OrderBy(a => a.type).ThenBy(a => a.label).ToList();
                if (prodRangeGetRes.DefProdRangelist != null && prodRangeGetRes.DefProdRangelist.Count > 0)
                {
                    defProdRangeList = prodRangeGetRes.DefProdRangelist.Select(a => new AutoCompleteTextBox {
                        value = a.VoyagerProductRange_Id, label = a.ProductRangeCode + " (" + a.PersonType + (a.AgeRange == null ? "" : " | " + a.AgeRange) + ")", type = a.AdditionalYN.ToString()
                    }).OrderBy(a => a.type).ThenBy(a => a.label).ToList();
                }
                return(Json(new { prodRangeGetRes.SupplierId, prodRangeGetRes.SupplierName, prodRangeList, defProdRangeList }));
            }
            else
            {
                return(Json(""));
            }
        }
示例#5
0
        public TourInfoHeaderViewModel GetSalesTourInfoHeader(ref NewQuoteViewModel modelQuote, string token)
        {
            SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);

            salesQuoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
            return(modelQuote.TourInfoHeaderViewModel);
        }
示例#6
0
 public PositionLibrary(IConfiguration configuration)
 {
     _configuration       = configuration;
     objMasterProviders   = new MasterProviders(_configuration);
     objPositionProviders = new PositionProviders(_configuration);
     salesQuoteLibrary    = new SalesQuoteLibrary(_configuration);
 }
示例#7
0
 public IActionResult QuoteFOC(QuoteFOCViewModel model)
 {
     try
     {
         SalesQuoteLibrary        quoteLibrary = new SalesQuoteLibrary(_configuration);
         IRequestCookieCollection objCookies   = HttpContext.Request.Cookies;
         var            sessionData            = string.IsNullOrEmpty(HttpContext.Request.Cookies["VoyagerUser_Id"]) ? HttpContext.Session.GetComplexData <List <ProductAttributeDetails> >(SessionName) : null;
         PaxSetResponse focSetResponse         = quoteLibrary.SetFOCDetails(_configuration, token, model, objCookies, sessionData);
         if (focSetResponse.Status.ToLower() == "success")
         {
             TempData["success"] = "FOC details saved successfully";
         }
         else
         {
             TempData["error"] = focSetResponse.Status;
         }
         return(RedirectToAction("GetFOC", new { model.QRFID }));
     }
     catch (Exception ex)
     {
         throw;
         TempData["error"] = ex.Message;
         return(RedirectToAction("GetFOC", new { model.QRFID }));
     }
 }
        public IActionResult IntercityTransfer()
        {
            try
            {
                string QRFID = Request.Query["QRFId"].ToString();
                IntercityTransferViewModel model = new IntercityTransferViewModel {
                    QRFID = QRFID
                };
                model.MenuViewModel.QRFID = QRFID;

                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                NewQuoteViewModel modelQuote   = new NewQuoteViewModel {
                    QRFID = model.MenuViewModel.QRFID
                };
                bool GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
                }

                return(View(model));
            }
            catch (Exception)
            {
                throw;
                return(View());
            }
        }
示例#9
0
 public MISController(IConfiguration configuration) : base(configuration)
 {
     _configuration   = configuration;
     objMISProviders  = new MISProviders(_configuration);
     agentProviders   = new AgentProviders(_configuration);
     objSalesProvider = new SalesProviders(_configuration);
     salesLibrary     = new SalesQuoteLibrary(_configuration);
 }
示例#10
0
        public IActionResult Activities(ActivitiesViewModel model)
        {
            string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName;
            IRequestCookieCollection objCookies     = HttpContext.Request.Cookies;
            SalesQuoteLibrary        salesLibrary   = new SalesQuoteLibrary(_configuration);
            PositionSetReq           positionSetReq = new PositionSetReq();
            bool isDuplicate = CheckDuplicateActivity(model);

            if (isDuplicate)
            {
                TempData["error"] = "Can not save same Activity for same day and time!!!";
                model.SaveType    = "full";
                //return PartialView("_Activities", model);
                return(RedirectToAction("Activities", new { model.QRFID, model.SaveType, model.MenuViewModel.IsClone }));
            }
            else
            {
                positionSetReq               = positionMapping.ActivitiesSet(model, ckUserEmailId);
                positionSetReq.QRFID         = model.QRFID;
                positionSetReq.VoyagerUserID = ckLoginUser_Id;
                positionSetReq.FOC           = model.FOC;
                positionSetReq.Price         = model.Price;
                PositionSetRes positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result;

                if (!string.IsNullOrEmpty(model.SaveType) && model.SaveType.ToLower() == "partial")
                {
                    if (positionSetRes.mPosition.Count > 0)
                    {
                        return(Json(new { positionSetRes.ResponseStatus.Status, positionSetRes.mPosition[0].PositionId, positionSetRes.mPosition[0].RoomDetailsInfo }));
                    }
                    else
                    {
                        return(Json(new { positionSetRes.ResponseStatus.Status }));
                    }
                }
                else
                {
                    if (positionSetRes.ResponseStatus.Status.ToLower() == "success")
                    {
                        TempData["success"] = "Activities saved successfully";
                    }
                    else
                    {
                        TempData["error"] = positionSetRes.ResponseStatus.Status;
                    }

                    model.SaveType = "full";
                    if (model.ActivityDetails.Count == 1)
                    {
                        return(RedirectToAction("Activities", new { model.QRFID, model.SaveType, PositionId = model.ActivityDetails[0].ActivityId, IsClone = model.MenuViewModel.IsClone }));
                    }
                    else
                    {
                        return(RedirectToAction("Activities", new { model.QRFID, model.SaveType, IsClone = model.MenuViewModel.IsClone }));
                    }
                }
            }
        }
示例#11
0
 public SupplierController(IHostingEnvironment env, IConfiguration configuration) : base(configuration)
 {
     _env              = env;
     _configuration    = configuration;
     masterProviders   = new MasterProviders(_configuration);
     agentProviders    = new AgentProviders(_configuration);
     supplierProviders = new SupplierProviders(_configuration);
     TaxTypeLibrary    = new SalesQuoteLibrary(_configuration);
 }
示例#12
0
        public IActionResult Quote()
        {
            QuoteSearchViewModel model        = new QuoteSearchViewModel();
            SalesQuoteLibrary    quoteLibrary = new SalesQuoteLibrary(_configuration);

            model = quoteLibrary.BindMasterData(_configuration, token);
            ViewBag.SearchResult = false;
            return(View(model));
        }
示例#13
0
        public IActionResult Rail(RailViewModel model)
        {
            IRequestCookieCollection objCookies     = HttpContext.Request.Cookies;
            SalesQuoteLibrary        salesLibrary   = new SalesQuoteLibrary(_configuration);
            PositionSetReq           positionSetReq = new PositionSetReq();

            positionSetReq               = positionMapping.RailSet(model, ckUserEmailId);
            positionSetReq.FOC           = model.FOC;
            positionSetReq.Price         = model.Price;
            positionSetReq.QRFID         = model.QRFID;
            positionSetReq.VoyagerUserID = ckLoginUser_Id;
            PositionSetRes positionSetRes = positionProviders.SetPosition(positionSetReq, token).Result;

            if (!string.IsNullOrEmpty(model.SaveType) && model.SaveType.ToLower() == "partial" && positionSetRes?.mPosition != null)
            {
                if (positionSetRes.mPosition.Count > 0)
                {
                    return(Json(new { positionSetRes.ResponseStatus.Status, positionSetRes.mPosition[0].PositionId, positionSetRes.mPosition[0].RoomDetailsInfo }));
                }
                else
                {
                    return(Json(new { positionSetRes.ResponseStatus.Status }));
                }
            }
            else
            {
                if (positionSetRes?.ResponseStatus?.Status?.ToLower() == "success")
                {
                    TempData["success"] = "Rail details saved successfully";
                }
                else if (!string.IsNullOrEmpty(positionSetRes?.ResponseStatus?.Status))
                {
                    TempData["error"] = positionSetRes?.ResponseStatus?.Status;
                }
                else
                {
                    TempData["error"] = "Error occured";
                }

                model.SaveType = "full";
                if (model.RailDetails.Count == 1)
                {
                    return(RedirectToAction("Rail", new { model.QRFID, model.SaveType, PositionId = model.RailDetails[0].RailId, model.MenuViewModel.IsClone }));
                }
                else
                {
                    return(RedirectToAction("Rail", new { model.QRFID, model.SaveType, model.MenuViewModel.IsClone }));
                }
            }
        }
示例#14
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;
            }
        }
示例#15
0
        public JsonResult GetProductRange(string ProductId, string CategoryId, string AdditionalYN, string positionname = "")
        {
            SalesQuoteLibrary  quoteLibrary    = new SalesQuoteLibrary(_configuration);
            ProductRangeGetRes prodRangeGetRes = quoteLibrary.GetProductRangeList(ProductId, CategoryId, AdditionalYN, token);

            List <AutoCompleteTextBox> prodRangeList = new List <AutoCompleteTextBox>();

            if (prodRangeGetRes.ResponseStatus.Status.ToLower() == "success" && prodRangeGetRes.ProductRangeDetails.Count > 0)
            {
                if (positionname == "cruise")
                {
                    var roomsuppliment = new List <AutoCompleteTextBox>();
                    var roomservice    = new List <AutoCompleteTextBox>();

                    roomservice = prodRangeGetRes.ProductRangeDetails.Where(a => a.AdditionalYN == false).ToList().
                                  Select(a => new AutoCompleteTextBox {
                        value = a.VoyagerProductRange_Id, label = a.ProductRangeCode + " (" + a.PersonType + (a.AgeRange == null ? "" : " | " + a.AgeRange) + ") ", type = a.AdditionalYN.ToString()
                    }).
                                  OrderBy(a => a.label.Contains("SINGLE") ? "A" : a.label.Contains("DOUBLE") ? "B" : a.label.Contains("TWIN") ? "C" : a.label.Contains("TRIPLE") ? "D" :
                                          a.label.Contains("QUAD") ? "E" : a.label.Contains("TSU") ? "F" :
                                          a.label.ToLower().Contains("child + bed") ? "G" : a.label.ToLower().Contains("child - bed") ? "H" :
                                          a.label.ToLower().Contains("infant") ? "I" : "J").ThenBy(a => a.label).ToList();

                    roomsuppliment = prodRangeGetRes.ProductRangeDetails.Where(a => a.AdditionalYN == true).
                                     Select(a => new AutoCompleteTextBox {
                        value = a.VoyagerProductRange_Id, label = a.ProductRangeCode + " (" + a.PersonType + (a.AgeRange == null ? "" : " | " + a.AgeRange) + ") ", type = a.AdditionalYN.ToString()
                    }).
                                     OrderBy(a => a.type).ThenBy(a => a.label).ToList();

                    roomservice.AddRange(roomsuppliment);
                    prodRangeList = roomservice;
                }
                else
                {
                    prodRangeList = prodRangeGetRes.ProductRangeDetails.Select(a => new AutoCompleteTextBox {
                        value = a.VoyagerProductRange_Id, label = a.ProductRangeCode + " (" + a.PersonType + (a.AgeRange == null ? "" : " | " + a.AgeRange) + ") ", type = a.AdditionalYN.ToString()
                    }).OrderBy(a => a.type).ThenBy(a => a.label).ToList();
                }

                return(Json(new { prodRangeGetRes.SupplierId, prodRangeGetRes.SupplierName, prodRangeList }));
            }
            else
            {
                return(Json(""));
            }
        }
示例#16
0
        public IActionResult QuoteMarginInformation(QuoteMarginViewModel model, bool IsCostingMargin = false)
        {
            IRequestCookieCollection objCookies = HttpContext.Request.Cookies;
            var sessionData = string.IsNullOrEmpty(HttpContext.Request.Cookies["VoyagerUser_Id"]) ? HttpContext.Session.GetComplexData <List <ProductAttributeDetails> >(SessionName) : null;
            SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);

            model.SubStep = "Margins";
            MarginSetRes objMarginSetRes = quoteLibrary.SetQRFMarginDetails(_configuration, token, model, objCookies, sessionData, IsCostingMargin);

            if (objMarginSetRes.ResponseStatus.Status.ToLower() == "success")
            {
                TempData["success"] = objMarginSetRes.ResponseStatus.ErrorMessage;
            }
            else
            {
                TempData["error"] = objMarginSetRes.ResponseStatus.ErrorMessage;
            }

            return(RedirectToAction("NewQuote", new { model.QRFID, SubStep = model.SubStep, IsCostingMargin = IsCostingMargin }));
        }
示例#17
0
        public IActionResult GetPaxRange(string QRFID)
        {
            NewQuoteViewModel model = new NewQuoteViewModel();

            try
            {
                bool GetStatus = false;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                if (!string.IsNullOrEmpty(QRFID))
                {
                    model.QRFID = QRFID;
                    model.mdlQuoteDateRangeViewModel.QRFID = QRFID;
                    GetStatus = quoteLibrary.GetQRFPaxSlabDetails(_configuration, token, ref model);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(PartialView("_QuotePaxRange", model.mdlQuotePaxRangeViewModel));
        }
示例#18
0
 public IActionResult QuoteAgentInformation(QuoteAgentInfoViewModel model)
 {
     try
     {
         //string SubStep = "";
         NewQuoteViewModel modelQuote   = new NewQuoteViewModel();
         SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
         if (ModelState.IsValid)
         {
             IRequestCookieCollection objCookies = HttpContext.Request.Cookies;
             var sessionData = string.IsNullOrEmpty(HttpContext.Request.Cookies["VoyagerUser_Id"]) ? HttpContext.Session.GetComplexData <List <ProductAttributeDetails> >(SessionName) : null;
             QuoteAgentSetRes objAgentResponse = quoteLibrary.SetQRFAgentDetails(_configuration, token, model, objCookies, sessionData);
             if (objAgentResponse.ResponseStatus.Status.ToLower() == "success")
             {
                 modelQuote.QRFID    = objAgentResponse.QRFID;
                 TempData["success"] = "QRF details saved successfully";
                 //SubStep = "DateRange";
                 //if (!string.IsNullOrEmpty(SubStep) && SubStep == "DateRange")
                 TempData["QuoteSaved"] = true;
             }
             else
             {
                 TempData["error"] = objAgentResponse.ResponseStatus.Status;
                 if (string.IsNullOrEmpty(modelQuote.QRFID))
                 {
                     modelQuote.QRFID = model.QRFID;
                 }
             }
         }
         return(RedirectToAction("NewQuote", new { modelQuote.QRFID }));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("NewQuote", new { model.QRFID }));
     }
 }
示例#19
0
        public IActionResult SubmitQuote(string QRFID, string QuoteRemarks, string Officer)
        {
            try
            {
                SalesQuoteLibrary        quoteLibrary = new SalesQuoteLibrary(_configuration);
                IRequestCookieCollection objCookies   = HttpContext.Request.Cookies;
                var sessionData = string.IsNullOrEmpty(HttpContext.Request.Cookies["VoyagerUser_Id"]) ? HttpContext.Session.GetComplexData <List <ProductAttributeDetails> >(SessionName) : null;

                QuoteSetRes objResponse = quoteLibrary.SetQuoteDetails(_configuration, token, QRFID, QuoteRemarks, Officer, objCookies, sessionData);

                if (objResponse?.ResponseStatus?.Status?.ToLower() == "success")
                {
                    return(Json(new { responseText = "success" }));
                }
                else
                {
                    return(Json(new { responseText = objResponse?.ResponseStatus?.ErrorMessage, status = "error" }));
                }
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
示例#20
0
 public COCommonLibrary(IConfiguration configuration)
 {
     _configuration    = configuration;
     salesQuoteLibrary = new SalesQuoteLibrary(_configuration);
     coProviders       = new COProviders(_configuration);
 }
示例#21
0
        public IActionResult NewQuote()
        {
            try
            {
                string QRFID             = Request.Query["QRFId"];
                string SubStep           = Convert.ToString(Request.Query["SubStep"]);
                string Module            = Request.Query["Module"];
                string PartnerEntityCode = Request.Query["PartnerEntityCode"];
                string Application       = Request.Query["Application"];
                string Operation         = Request.Query["Operation"];
                string CompanyId         = Request.Query["CompanyId"];
                string ContactId         = Request.Query["ContactId"];

                if (!string.IsNullOrEmpty(SubStep) && SubStep == "Routing")
                {
                    NewQuoteViewModel model = GetRoutingDetails(QRFID);
                    return(PartialView("_QuoteRouting", model.mdlQuoteRoutingViewModel));
                }
                else if (!string.IsNullOrEmpty(SubStep) && SubStep == "Margins")
                {
                    bool IsCostingMargin    = Convert.ToBoolean(Request.Query["IsCostingMargin"]);
                    NewQuoteViewModel model = GetMarginDetails(QRFID, IsCostingMargin);
                    TempData["IsCostingMargin"] = IsCostingMargin;
                    return(PartialView("_QuoteMargins", model.mdlQuoteMarginViewModel));
                }
                else
                {
                    NewQuoteViewModel model = new NewQuoteViewModel();
                    bool GetStatus          = false;
                    model.mdlMenuViewModel.QRFID                       = QRFID;
                    model.mdlQuoteAgentInfoViewModel.Module            = Module;
                    model.mdlQuoteAgentInfoViewModel.PartnerEntityCode = PartnerEntityCode;
                    model.mdlQuoteAgentInfoViewModel.Application       = Application;
                    model.mdlQuoteAgentInfoViewModel.Operation         = Operation;
                    SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                    #region Agent Info
                    if (!string.IsNullOrEmpty(QRFID))
                    {
                        QuoteThirdPartyGetReq modelreq = new QuoteThirdPartyGetReq();
                        model.QRFID    = QRFID;
                        modelreq.QrfID = QRFID;
                        model.mdlQuoteDateRangeViewModel.QRFID = QRFID;
                        GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref model);

                        QuoteThirdPartyGetRes response = salesProviders.GetPartnerQuoteDetails(modelreq, token).Result;
                        if (response != null)
                        {
                            model.mdlQuoteAgentInfoViewModel.Module            = response?.PartnerEntityName;
                            model.mdlQuoteAgentInfoViewModel.PartnerEntityCode = response?.PartnerEntityCode;
                            model.mdlQuoteAgentInfoViewModel.Application       = response?.ApplicationName?.ToLower();
                        }
                    }
                    else if (!string.IsNullOrEmpty(ContactId) && !string.IsNullOrEmpty(CompanyId))
                    {
                        model.mdlQuoteAgentInfoViewModel.AgentId = CompanyId;
                        var agentInfo = agentProviders.GetAgentDetailedInfo(new AgentGetReq()
                        {
                            CompanyId = CompanyId
                        }, token).Result;
                        model.mdlQuoteAgentInfoViewModel.AgentName     = agentInfo.AgentDetails.Name;
                        model.mdlQuoteAgentInfoViewModel.ContactPerson = ContactId;
                        var contactInfo = agentInfo.AgentDetails.ContactDetails.Where(a => a.Contact_Id == ContactId).FirstOrDefault();
                        model.mdlQuoteAgentInfoViewModel.Email    = contactInfo.MAIL;
                        model.mdlQuoteAgentInfoViewModel.MobileNo = contactInfo.MOBILE;
                    }

                    quoteLibrary.LoadQuoteAgentInfo(_configuration, token, ref model, ckUserEmailId, ckUserCompanyId);
                    #endregion

                    if (model.mdlQuoteAgentInfoViewModel.ContactPersonList.Count == 0)
                    {
                        model.mdlQuoteAgentInfoViewModel.MobileNo = "";
                        model.mdlQuoteAgentInfoViewModel.Email    = "";
                    }

                    return(View(model));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#22
0
        public IActionResult GetItineraryData(string QRFID, string filterByDay = null, string filterByServiceType = null, string PageName = "QRFSummary")
        {
            try
            {
                QRFSummaryViewModel model = new QRFSummaryViewModel();
                model.PageName = PageName;

                #region Get Quote Info By QRFId
                NewQuoteViewModel modelQuote = new NewQuoteViewModel();
                modelQuote.QRFID = QRFID;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                bool GetStatus = false;
                GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
                }
                #endregion

                #region Get Itinerary Details by QRFId
                itineraryGetReq       = new ItineraryGetReq();
                itineraryGetReq.QRFID = QRFID;
                itineraryGetRes       = coProviders.GetItinerary(itineraryGetReq, token).Result;
                model.Itinerary       = itineraryGetRes.Itinerary;
                #endregion

                #region Filter Dropdown Bindings
                model.DayList         = GetDays(model.Itinerary.ItineraryDays);
                model.ServiceTypeList = GetProductTypes(model.Itinerary.ItineraryDays);
                #endregion

                if (filterByDay == "Day")
                {
                    filterByDay = null;
                }

                if (filterByServiceType == "Service Type")
                {
                    filterByServiceType = null;
                }

                if (!string.IsNullOrEmpty(filterByDay))
                {
                    model.Itinerary.ItineraryDays = model.Itinerary.ItineraryDays.Where(x => x.Day == filterByDay).ToList();
                }

                if (!string.IsNullOrEmpty(filterByServiceType))
                {
                    for (int i = 0; i < model.Itinerary.ItineraryDays.Count; i++)
                    {
                        model.Itinerary.ItineraryDays[i].ItineraryDescription = model.Itinerary.ItineraryDays[i].ItineraryDescription.Where(x => x.ProductType == filterByServiceType).ToList();
                    }
                }
                model.Days     = filterByDay;
                model.Services = filterByServiceType;
                return(PartialView("_QRFSummary", model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#23
0
        public IActionResult GetItinerary(string QRFID, string filterByDay = null, string filterByServiceType = null, long filterByDeparture = 0, long filterByPaxSlab = 0)
        {
            try
            {
                ItineraryViewModel model = new ItineraryViewModel();

                #region Get Quote Info By QRFId
                NewQuoteViewModel modelQuote = new NewQuoteViewModel();
                modelQuote.QRFID = QRFID;
                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                bool GetStatus = false;
                GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel       = modelQuote.TourInfoHeaderViewModel;
                    model.MenuViewModel.EnquiryPipeline = modelQuote.mdlMenuViewModel.EnquiryPipeline;
                }
                #endregion

                #region Get Itinerary Details by QRFId
                itineraryGetReq          = new ItineraryGetReq();
                itineraryGetReq.QRFID    = QRFID;
                itineraryGetReq.editUser = ckUserEmailId;
                itineraryGetRes          = coProviders.GetItineraryDetails(itineraryGetReq, token).Result;
                model.Itinerary          = itineraryGetRes.Itinerary;
                #endregion

                #region Get Costsheet by QRFId
                NewQuoteViewModel modelQuote1 = new NewQuoteViewModel();
                bool GetStatus1 = false;
                SalesQuoteLibrary quoteLibrary1 = new SalesQuoteLibrary(_configuration);
                if (!string.IsNullOrEmpty(QRFID))
                {
                    modelQuote1.QRFID = QRFID;
                    GetStatus1        = quoteLibrary1.GetQRFPaxSlabDetails(_configuration, token, ref modelQuote1);
                }
                SalesProviders          objSalesProvider     = new SalesProviders(_configuration);
                DepartureDateGetRequest objDepartureDatesReq = new DepartureDateGetRequest()
                {
                    QRFID = QRFID, date = (DateTime?)null
                };
                DepartureDateGetResponse objDepartureDatesRes = objSalesProvider.GetDepartureDatesForQRFId(objDepartureDatesReq, token).Result;
                model.PaxSlabList = (modelQuote1.mdlQuotePaxRangeViewModel.QuotePaxSlabDetails).Select(a => new AttributeValues {
                    AttributeValue_Id = a.PaxSlabId.ToString(), Value = a.PaxSlabFrom + "-" + a.PaxSlabTo
                }).ToList();
                model.DepartureDatesList = (objDepartureDatesRes.DepartureDates).Select(a => new AttributeValues {
                    AttributeValue_Id = a.Departure_Id.ToString(), Value = Convert.ToDateTime(a.Date).ToString("dd MMM yy")
                }).ToList();
                long            defaultPaxSlabId = Convert.ToInt32(model.PaxSlabList[0].AttributeValue_Id);
                CostsheetGetReq request          = new CostsheetGetReq();
                CostsheetGetRes response         = new CostsheetGetRes();
                request.QRFID       = QRFID;
                request.DepartureId = filterByDeparture == 0 ? objDepartureDatesRes.DepartureDates[0].Departure_Id : filterByDeparture;
                request.PaxSlabId   = filterByPaxSlab == 0 ? defaultPaxSlabId : filterByPaxSlab;
                response            = coProviders.GetCostsheet(request, token).Result;
                #endregion

                #region Price Per Person Binding
                List <ItineraryDaysInfo>    lstDays      = itineraryGetRes.Itinerary.ItineraryDays.ToList();
                List <QRFPkgAndNonPkgPrice> lstPositions = new List <QRFPkgAndNonPkgPrice>();

                foreach (var a in lstDays)
                {
                    List <ItineraryDescriptionInfo> lstdes = a.ItineraryDescription.Where(x => x.KeepAs.ToUpper() != "INCLUDED").ToList();
                    foreach (var k in response.QrfNonPackagePrice.Where(y => y.RoomName.ToUpper() == "ADULT"))
                    {
                        foreach (var l in lstdes)
                        {
                            if (l.PositionId == k.PositionId)
                            {
                                lstPositions.Add(new QRFPkgAndNonPkgPrice {
                                    QRFCurrency = string.IsNullOrEmpty(k.QRFCurrency) ? "" : k.QRFCurrency.Substring(0, 3).ToUpper(), SellPrice = k.SellPrice, PositionId = k.PositionId, PositionKeepAs = k.PositionKeepAs, PaxSlabId = k.PaxSlab_Id, ProductName = k.ProductName, RoomName = k.RoomName
                                });
                            }
                        }
                    }
                }

                model.ListNonQrfPkgPositions = lstPositions;
                #endregion

                #region Filter Dropdown Bindings
                model.DayList         = GetDays(itineraryGetRes.Itinerary.ItineraryDays);
                model.ServiceTypeList = GetProductTypes(model.Itinerary.ItineraryDays);
                #endregion

                #region Date Binding
                if (filterByDay == "Day")
                {
                    filterByDay = null;
                }

                if (filterByServiceType == "Service Type")
                {
                    filterByServiceType = null;
                }

                if (!string.IsNullOrEmpty(filterByDay))
                {
                    model.Itinerary.ItineraryDays = model.Itinerary.ItineraryDays.Where(x => x.Day == filterByDay).ToList();
                }

                if (!string.IsNullOrEmpty(filterByServiceType))
                {
                    for (int i = 0; i < model.Itinerary.ItineraryDays.Count; i++)
                    {
                        model.Itinerary.ItineraryDays[i].ItineraryDescription = model.Itinerary.ItineraryDays[i].ItineraryDescription.Where(x => x.ProductType == filterByServiceType).ToList();
                    }
                }
                model.Days          = filterByDay;
                model.Services      = filterByServiceType;
                model.DepartureDate = filterByDeparture;
                model.PaxSlab       = filterByPaxSlab;
                #endregion

                return(PartialView("_Itinerary", model));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#24
0
        public IActionResult Others()
        {
            OthersViewModel model = new OthersViewModel();

            try
            {
                string ReturnView  = "";
                string QRFID       = Request.Query["QRFId"].ToString();
                string SaveType    = Request.Query["SaveType"].ToString();
                string PositionId  = Request.Query["PositionId"];
                string ProductType = Request.Query["ProductType"];
                bool   IsClone     = Convert.ToBoolean(Request.Query["IsClone"]);
                model.OthersLocalGuide.QRFID   = QRFID;
                model.MenuViewModel.QRFID      = QRFID;
                model.MenuViewModel.PositionId = PositionId;
                if (ProductType.ToLower() == "guide")
                {
                    model.MenuViewModel.MenuName = "LocalGuide";
                }
                PositionGetReq positionGetReq = new PositionGetReq {
                    QRFID = QRFID, IsClone = IsClone
                };
                if (!string.IsNullOrEmpty(PositionId) && PositionId.Substring(0, 8) != "00000000")
                {
                    positionGetReq.PositionId = PositionId;
                }
                else
                {
                    if (string.IsNullOrEmpty(ProductType) || ProductType.ToLower() == "guide")
                    {
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Guide"
                        });
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Assistant"
                        });
                    }
                    else if (!string.IsNullOrWhiteSpace(ProductType) && (ProductType.ToLower() == "other" || ProductType.ToLower() == "fee"))
                    {
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Other"
                        });
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = "Fee"
                        });
                    }
                    else
                    {
                        positionGetReq.ProductType.Add(new ProductType {
                            ProdType = ProductType
                        });
                    }
                }

                PositionGetRes positionGetRes = positionProviders.GetPosition(positionGetReq, token).Result;

                SalesQuoteLibrary quoteLibrary = new SalesQuoteLibrary(_configuration);
                NewQuoteViewModel modelQuote   = new NewQuoteViewModel {
                    QRFID = model.MenuViewModel.QRFID
                };
                bool GetStatus = quoteLibrary.GetQRFAgentByQRFId(_configuration, token, ref modelQuote);
                if (GetStatus)
                {
                    model.TourInfoHeaderViewModel = modelQuote.TourInfoHeaderViewModel;
                }

                positionMapping.OthersLocalGuideGet(positionGetRes, ref model, token);

                switch (string.IsNullOrEmpty(ProductType) ? "" : ProductType.ToLower())
                {
                case "guide": ReturnView = "_OthersLocalGuide"; break;

                case "visa": ReturnView = "_OthersVisa"; break;

                case "insurance": ReturnView = "_OthersInsurance"; break;

                case "other": ReturnView = "_OthersMiscellaneous"; break;

                default: ReturnView = "_OthersLocalGuide"; break;
                }

                if (string.IsNullOrEmpty(PositionId) || PositionId.Substring(0, 8) == "00000000")
                {
                    if (!string.IsNullOrEmpty(SaveType) && SaveType.ToLower() == "full")
                    {
                        model.OthersLocalGuide.SaveType = "success";
                        return(PartialView(ReturnView, model.OthersLocalGuide));
                    }
                    else
                    {
                        return(View(model));
                    }
                }
                else
                {
                    return(PartialView(ReturnView, model.OthersLocalGuide));
                }
            }
            catch (Exception ex)
            {
                return(View(model));
            }
        }
示例#25
0
        public IActionResult LocalGuide(OthersLocalGuide model)
        {
            string UserName = HttpContext.Request.Cookies["UserName"] ?? ckUserName;
            IRequestCookieCollection objCookies      = HttpContext.Request.Cookies;
            SalesQuoteLibrary        salesLibrary    = new SalesQuoteLibrary(_configuration);
            PositionSetRes           positionSetRes  = new PositionSetRes();
            PositionSetReq           positionSetReq  = new PositionSetReq();
            OthersViewModel          othersViewModel = new OthersViewModel {
                OthersLocalGuide = model, MenuViewModel = new MenuViewModel {
                    IsClone = model.IsClone
                }
            };

            if (model.LocalGuideDetails.Count > 0)
            {
                positionSetReq               = positionMapping.OthersLocalGuideSet(othersViewModel, ckUserEmailId);
                positionSetReq.FOC           = model.FOC;
                positionSetReq.Price         = model.Price;
                positionSetReq.QRFID         = model.QRFID;
                positionSetReq.VoyagerUserID = ckLoginUser_Id;
                positionSetRes               = positionProviders.SetPosition(positionSetReq, token).Result;
            }

            if (!string.IsNullOrEmpty(model.SaveType) && model.SaveType.ToLower() == "partial")
            {
                if (positionSetRes.mPosition.Count > 0)
                {
                    return(Json(new { positionSetRes.ResponseStatus.Status, positionSetRes.mPosition[0].PositionId, positionSetRes.mPosition[0].RoomDetailsInfo }));
                }
                else
                {
                    return(Json(new { positionSetRes.ResponseStatus.Status }));
                }
            }
            else
            {
                if (positionSetRes.ResponseStatus.Status.ToLower() == "success")
                {
                    TempData["success"] = "Data saved successfully";
                }
                else
                {
                    TempData["error"] = positionSetRes.ResponseStatus.Status;
                }

                model.SaveType = "full";
                if (model.LocalGuideDetails.Count == 1)
                {
                    var prodtype = model.LocalGuideDetails[0].ProductType == "Assistant" ? "Guide" : model.LocalGuideDetails[0].ProductType == "Fee" ? "Other" : model.LocalGuideDetails[0].ProductType;
                    return(RedirectToAction("Others", new { model.QRFID, model.SaveType, PositionId = model.LocalGuideDetails[0].OthersId, ProductType = prodtype }));
                }
                else
                {
                    if (model.LocalGuideDetails.Count > 0)
                    {
                        var prodtype = model.LocalGuideDetails[0].ProductType == "Assistant" ? "Guide" : model.LocalGuideDetails[0].ProductType == "Fee" ? "Other" : model.LocalGuideDetails[0].ProductType;
                        return(RedirectToAction("Others", new { model.QRFID, model.SaveType, ProductType = prodtype }));
                    }
                    else
                    {
                        return(RedirectToAction("Others", new { model.QRFID, model.SaveType }));
                    }
                }
            }
        }
示例#26
0
        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));
        }