public JsonResult AirlineAutoComplete(string Prefix, string errorMsg) { List <AirlineModel> AirlineList = new List <AirlineModel>(); AirlineList = UtilitiesService.AirlineAutoComplete(Prefix); return(Json(AirlineList.Select(x => new { label = x.airline, id = x.code, value = x.airline }).Distinct().ToArray(), JsonRequestBehavior.AllowGet)); }
private void btnThem_Click(object sender, EventArgs e) { txtMaVatTu.Text = UtilitiesService.AutoGenarateCode(Config.P_VT); txtTenVatTu.Text = ""; txtDonViTinh.Text = ""; txtDonGiaBan.Text = ""; txtDonGiaNhap.Text = ""; currentVatTu = new VatTu(); }
public ActionResult Addon(ProductTourPackage prodTour, string tripid) { CheckoutProduct checkout = (CheckoutProduct)Core.GetSession(Enumeration.SessionName.CheckoutProduct, tripid); checkout.TourPackage.TourPackagesInfo.EntranceID = prodTour.TourPackagesInfo.EntranceID; checkout.TourPackage.TourPackagesInfo.LanguageID = prodTour.TourPackagesInfo.LanguageID; checkout.TourPackage.TourPackagesInfo.SpecialRequest = prodTour.TourPackagesInfo.SpecialRequest; checkout.TourPackage.TourPackagesInfo.TransportPackageID = prodTour.TourPackagesInfo.TransportPackageID; int NoOfPax = checkout.TourPackage.TourPackagesInfo.NoOfPax; var tourProdDetail = checkout.TourPackage.TourPackageDetails; checkout.TourPackage.PricingDetail.Items.RemoveAll(x => x.ItemDetail.Contains("Tour Guide:") || x.ItemDetail.Contains("Entrances Ticket:") || x.ItemDetail.Contains("Transport Package: ")); if (checkout.TourPackage.TourPackagesInfo.LanguageID != 0) { var languages = UtilitiesService.GetTourLanguageList(checkout.TourPackage.TourPackagesInfo.LanguageID); var lang = languages.FirstOrDefault(x => x.LanguageID == checkout.TourPackage.TourPackagesInfo.LanguageID); checkout.TourPackage.PricingDetail.Items.Add(new ProductItem() { ItemDetail = "Tour Guide: " + lang.Language, ItemQty = 1, BaseRate = lang.TourLanguagePrices.FirstOrDefault().SellingPrice, Surcharge = 0, Supplier_TotalAmt = lang.TourLanguagePrices.FirstOrDefault().Cost, GST = 0, }); } if (checkout.TourPackage.TourPackagesInfo.EntranceID != 0) { var entranceDetail = tourProdDetail.EntranceTickets.Where(x => x.EntranceID == checkout.TourPackage.TourPackagesInfo.EntranceID).FirstOrDefault(); checkout.TourPackage.PricingDetail.Items.Add(new ProductItem() { ItemDetail = "Entrances Ticket: " + entranceDetail.Ticket, ItemQty = NoOfPax, BaseRate = entranceDetail.SellingPrice, Surcharge = 0, Supplier_TotalAmt = entranceDetail.Cost * NoOfPax, GST = 0, }); } if (checkout.TourPackage.TourPackagesInfo.TransportPackageID != 0) { var transportDetail = tourProdDetail.TransportPackages.Where(x => x.TransportPackageID == checkout.TourPackage.TourPackagesInfo.TransportPackageID).FirstOrDefault(); checkout.TourPackage.PricingDetail.Items.Add(new ProductItem() { ItemDetail = "Transport Package: " + transportDetail.Description, ItemQty = NoOfPax, BaseRate = transportDetail.SellingPrice, Surcharge = 0, Supplier_TotalAmt = transportDetail.Cost * NoOfPax, GST = 0, }); } return(RedirectToAction("Contact", "TourPackage", new { tripid, affiliationId })); }
private void btnThem_Click(object sender, EventArgs e) { txtMaKho.Text = UtilitiesService.AutoGenarateCode(Config.P_KHO); txtTenKho.Text = ""; txtDiaChi.Text = ""; txtGhiChu.Text = ""; txtSDT.Text = ""; cboQuanLy.Text = ""; txtIdKho.Text = ""; currentKho = new Kho(); }
private void btnThem_Click(object sender, EventArgs e) { txtMaNhaCungCap.Text = UtilitiesService.AutoGenarateCode(Config.P_NHACC); txtTenNhaCungCap.Text = ""; txtDiaChi.Text = ""; txtEmail.Text = ""; txtSDT.Text = ""; txtNguoiDaiDien.Text = ""; txtIdNhaCungCap.Text = ""; currentNhaCungCap = new NhaCungCap(); }
public bool TourPackageEnquiry(ProductTourPackage prodTour, string travelerdata, string enquiryQuestion, string tripid) { CheckoutProduct checkout = (CheckoutProduct)Core.GetSession(Enumeration.SessionName.CheckoutProduct, tripid); bool successSend = false; try { if (checkout != null) { checkout.TourPackage.ContactPerson = prodTour.ContactPerson; var tourdtl = checkout.TourPackage.TourPackageDetails; var tourinfo = checkout.TourPackage.TourPackagesInfo; var hotelSelected = ""; if (tourinfo.RoomListSelected != null) { int star = UtilitiesService.GetTourRoomRating(tourinfo.RoomListSelected.FirstOrDefault().RoomTypeID); hotelSelected = star + (star > 1 ? " stars" : " star") + "<br/>" + string.Join("<br/>", tourinfo.TourRoomPackages.Select(x => x.RoomTypeName + " x " + x.Qty)); } decimal ttlprice = checkout.CheckOutSummary.GrandTtlAmt_BeforeDiscount; decimal deposit = ttlprice; decimal depositrate = tourdtl.DepositRate ?? 0; if ((tourdtl.IsDepositOnly ?? false) && depositrate > 0) { deposit = tourdtl.DepositTypeCode == "FIX" ? depositrate * tourinfo.NoOfPax : ttlprice * depositrate / 100; } Hashtable ht = new Hashtable(); ht.Add("<#UserName>", prodTour.ContactPerson.GivenName + " " + prodTour.ContactPerson.Surname); ht.Add("<#PackageName>", tourdtl.TourPackageName); ht.Add("<#TravelDate>", tourinfo.TravelDateFrom.ToString("dd/MM/yyyy") + " - " + tourinfo.TravelDateTo.ToString("dd/MM/yyyy")); ht.Add("<#HotelSelection>", hotelSelected); ht.Add("<#TourCode>", tourdtl.TourPackageCode); ht.Add("<#TtlPrice>", ttlprice.ToString("n2")); ht.Add("<#Email>", checkout.TourPackage.ContactPerson.Email); ht.Add("<#EnquiryQ>", enquiryQuestion); var CSemail = Core.GetSettingValue("MayflowerCSEmail"); successSend = CommonServiceController.SendEmail(CSemail, "Ground Package Enquiry Email", Core.getMailTemplate("tourpackageenquiry", ht)); if (!successSend) { logger.Fatal("errmsg", "Tour Package send enquiry email error." + " - " + DateTime.Now.ToLoggerDateTime()); } } } catch (Exception ex) { logger.Fatal(ex, "Tour Package enquiry email error" + " - " + DateTime.Now.ToLoggerDateTime()); } return(successSend); }
private void DisabledControl() { if (ucXuatKho.idPhieuXuat != 0) { txtMa.Enabled = false; cboKho.Enabled = false; } else { txtMa.Enabled = false; txtMa.Text = UtilitiesService.AutoGenarateCode("PX"); } }
private void DisabledControl() { if (ucNhapKho.idPhieuNhap != 0) { txtMa.Enabled = false; cboNhaCungCap.Enabled = false; } else { txtMa.Enabled = false; txtMa.Text = UtilitiesService.AutoGenarateCode("PN"); } }
private void btnThem_Click(object sender, EventArgs e) { txtManhanVien.Text = UtilitiesService.AutoGenarateCode(Config.P_NV); txtTennhanVien.Text = ""; txtDiaChi.Text = ""; txtEmail.Text = ""; txtSDT.Text = ""; txtCMND.Text = ""; txtIdNhanVien.Text = ""; dateTimeInput1.Value = DateTime.Now; dateTimeInput2.Value = DateTime.Now; rdNam.Checked = true; currentnhanVien = new NhanVien(); }
/// <summary> /// Get details about User. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="UserIds">Array of user ids</param> /// <returns></returns> public UserReturnValue GetUser(HostSecurityToken oHostSecurityToken, Guid userMemberId) { UserReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.GetUser(Functions.GetLogonIdFromToken(oHostSecurityToken), userMemberId); } else { returnValue = new UserReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return returnValue; }
/// <summary> /// Get details about multiple Users. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="UserIds">Array of user ids</param> /// <returns></returns> public UserSearchReturnValue GetMultipleUserDetails(HostSecurityToken oHostSecurityToken, int[] UserIds) { UserSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.GetMultipleUserDetails(Functions.GetLogonIdFromToken(oHostSecurityToken), UserIds); } else { returnValue = new UserSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return returnValue; }
/// <summary> /// Get details about User. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="UserIds">Array of user ids</param> /// <returns></returns> public UserReturnValue GetUser(HostSecurityToken oHostSecurityToken, Guid userMemberId) { UserReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.GetUser(Functions.GetLogonIdFromToken(oHostSecurityToken), userMemberId); } else { returnValue = new UserReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
/// <summary> /// Get details about User. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="UserIds">Array of user ids</param> /// <returns></returns> public WorkTypeReturnValue GetWorkType(HostSecurityToken oHostSecurityToken, Guid workTypeId) { WorkTypeReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.GetWorkType(Functions.GetLogonIdFromToken(oHostSecurityToken), workTypeId); } else { returnValue = new WorkTypeReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
/// <summary> /// Get details about multiple Users. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="UserIds">Array of user ids</param> /// <returns></returns> public UserSearchReturnValue GetMultipleUserDetails(HostSecurityToken oHostSecurityToken, int[] UserIds) { UserSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.GetMultipleUserDetails(Functions.GetLogonIdFromToken(oHostSecurityToken), UserIds); } else { returnValue = new UserSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
/// <summary> /// Search for a user /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="collectionRequest"></param> /// <param name="criteria"></param> /// <returns></returns> public UserSearchReturnValue UserSearch(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest, UserSearchCriteria criteria) { UserSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.UserSearch(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, criteria); } else { returnValue = new UserSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return(returnValue); }
public ActionResult GetTourPackage(int TourPackageID) { string tripid = Guid.NewGuid().ToString(); var tour = new ProductTourPackage(TourPackageID); var langList = UtilitiesService.GetTourLanguageList(tour.TourPackageID); var entrances = tour.TourPackageDetails.EntranceTickets.ToList(); var transportDetail = tour.TourPackageDetails.TransportPackages.ToList(); if (!((langList != null && langList.Count > 0) || (entrances != null && entrances.Count > 0) || (transportDetail != null && transportDetail.Count > 0))) { tour.skipAddon = true; } CheckoutProduct checkout = new CheckoutProduct(); checkout.InsertProduct(tour); Core.SetSession(Enumeration.SessionName.CheckoutProduct, tripid, checkout); return(RedirectToAction("Search", "TourPackage", new { tripid })); }
public ActionResult UpdateTourAddonPrice(string tripid, int transportID = 0, int entranceID = 0, int languageID = 0) { CheckoutProduct checkout = (CheckoutProduct)Core.GetSession(Enumeration.SessionName.CheckoutProduct, tripid); dynamic obj = new System.Dynamic.ExpandoObject(); var tourInfo = checkout.TourPackage.TourPackageDetails; int NoOfPax = checkout.TourPackage.TourPackagesInfo.NoOfPax; var displayhtml = ""; decimal tourprice = checkout.TourPackage.PricingDetail.ProductTotalAmount; decimal entrancePrice = 0; decimal transportPrice = 0; decimal languagePrice = 0; if (transportID != 0) { var transportDetail = tourInfo.TransportPackages.Where(x => x.TransportPackageID == transportID).FirstOrDefault(); transportPrice = transportDetail.SellingPrice * NoOfPax; displayhtml += "<li class='reservation-room tpaddon'><span>" + transportDetail.Description + " x " + NoOfPax + "</span>"; displayhtml += "<span>MYR" + transportPrice.ToString("n2") + "</span></li>"; } if (entranceID != 0) { var entranceDetail = tourInfo.EntranceTickets.Where(x => x.EntranceID == entranceID).FirstOrDefault(); transportPrice = entranceDetail.SellingPrice * NoOfPax; displayhtml += "<li class='reservation-room addon'><span>" + entranceDetail.Ticket + " x " + NoOfPax + "</span>"; displayhtml += "<span>MYR" + transportPrice.ToString("n2") + "</span></li>"; } if (languageID != 0) { var languages = UtilitiesService.GetTourLanguageList(checkout.TourPackage.TourPackagesInfo.LanguageID); var lang = languages.FirstOrDefault(x => x.LanguageID == checkout.TourPackage.TourPackagesInfo.LanguageID); transportPrice = lang.TourLanguagePrices.FirstOrDefault().SellingPrice *NoOfPax; displayhtml += "<li class='reservation-room addon'><span>" + lang.Language + "</span>"; displayhtml += "<span>MYR" + transportPrice.ToString("n2") + "</span></li>"; } decimal ttlprice = tourprice + entrancePrice + languagePrice + transportPrice; obj.ttl = ttlprice.ToString("n2"); obj.ttlper = NoOfPax != 0 ? (ttlprice / NoOfPax).ToString("n2") : "0.00"; obj.roomdesc = displayhtml; return(Content(JsonConvert.SerializeObject(obj), "application/json")); }
public async Task Avatar(IUser user = null) => await ReplyAsync(embed : UtilitiesService.GetAvatar(Context, user));
public async Task Lmgtfy([Name("text to search")][Remainder] string textToSearch) => await ReplyAsync(UtilitiesService.Lmgtfy(textToSearch));
public async Task ConvertCurrency(string from, string to, string value) => await ReplyAsync(embed : await UtilitiesService.ConvertCurrencyAsync(from, to, value));
public async Task Poll(string question, [Name("choice 1")] string choice1, [Name("choice 2")] string choice2) => await UtilitiesService.CreatePollAsync(question, choice1, choice2, Context);
public async Task RandomNumber([Name("first number")] int minVal = 0, [Name("last number")] int maxVal = 100) => await ReplyAsync(embed : UtilitiesService.RandomNumber(minVal, maxVal));
public ManualController(DatabaseContext context, IMapper mapper, UtilitiesService utilities) { _db = context; _mapper = mapper; _utilities = utilities; }
/// <summary> /// Get details about User. /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="UserIds">Array of user ids</param> /// <returns></returns> public WorkTypeReturnValue GetWorkType(HostSecurityToken oHostSecurityToken, Guid workTypeId) { WorkTypeReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.GetWorkType(Functions.GetLogonIdFromToken(oHostSecurityToken), workTypeId); } else { returnValue = new WorkTypeReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return returnValue; }
public ActionResult Search(ProductTourPackage prodTour, string tripid) { CheckoutProduct checkout = (CheckoutProduct)Core.GetSession(Enumeration.SessionName.CheckoutProduct, tripid); int TourPackageID = checkout.TourPackage.TourPackageID; var tourprod = new ProductTourPackage(TourPackageID); checkout.TourPackage.TourPackagesInfo = prodTour.TourPackagesInfo; if (tourprod.TourPackageDetails.PackageHotels.Count == 0 || tourprod.TourPackageDetails.PackageRoomTypes.Count == 0) { var tourProdDetail = checkout.TourPackage.TourPackageDetails; int NoOfPax = checkout.TourPackage.TourPackagesInfo.NoOfPax; List <ProductItem> tourproducts = new List <ProductItem>(); tourproducts.Add(new ProductItem() { ItemDetail = tourProdDetail.TourPackageName, ItemQty = NoOfPax, BaseRate = tourProdDetail.SellingPrice, Surcharge = 0, Supplier_TotalAmt = tourProdDetail.Cost * NoOfPax, GST = 0, }); if (checkout.TourPackage.TourPackagesInfo.ExtensionNight != 0) { int totalextension = checkout.TourPackage.TourPackagesInfo.ExtensionNight; tourproducts.Add(new ProductItem() { ItemDetail = "Extension", ItemQty = totalextension, BaseRate = tourProdDetail.ExtensionPrice ?? 0, Surcharge = 0, Supplier_TotalAmt = (tourProdDetail.ExtensionPrice ?? 0) * totalextension, GST = 0, }); } ProductPricingDetail tourPricingDetail = new ProductPricingDetail { Sequence = 5, Currency = "MYR", Items = tourproducts, Discounts = new List <DiscountDetail>(), }; ProductTourPackage producttour = new ProductTourPackage() { TourPackageID = TourPackageID, TourPackageDetails = checkout.TourPackage.TourPackageDetails, TourPackagesInfo = checkout.TourPackage.TourPackagesInfo, ProductSeq = 5, PricingDetail = tourPricingDetail, }; if (checkout.TourPackage != null) { checkout.RemoveProduct(ProductTypes.TP); } checkout.InsertProduct(producttour); var langList = UtilitiesService.GetTourLanguageList(TourPackageID); var entrances = tourProdDetail.EntranceTickets.ToList(); var transportDetail = tourProdDetail.TransportPackages.ToList(); if (!((langList != null && langList.Count > 0) || (entrances != null && entrances.Count > 0) || (transportDetail != null && transportDetail.Count > 0))) { checkout.TourPackage.skipAddon = true; } if (checkout.TourPackage.skipAddon || true) { return(RedirectToAction("Contact", "TourPackage", new { tripid, affiliationId })); } else { return(RedirectToAction("Addon", "TourPackage", new { tripid, affiliationId })); } } else { return(RedirectToAction("Hotel", "TourPackage", new { tripid, affiliationId })); } }
public Utilities(UtilitiesService utilitiesService, DiscordSocketClient client) { _utilitiesService = utilitiesService; _client = client; }
public ActionResult Index(FlightBookingModel model, [Bind(Exclude = "SearchResults")] SearchFlightResultViewModel searchModel) { tripid = Guid.NewGuid().ToString(); sessionNameBooking = Enumeration.SessionName.FlightBooking + tripid; #region 2017/02/28 - Development Region, For Get Result from Dummy Cloned Set bool useDumpResultList = false; bool.TryParse(Core.GetAppSettingValueEnhanced("UseDumpResultList"), out useDumpResultList); if (useDumpResultList) { var dumpModel = GetDumpFlightBookingModel("FlightListResultFullList.txt"); Session[sessionNameBooking] = dumpModel; Session["FullFlightSearchResult"] = dumpModel.FlightSearchResultViewModel.FullFlightSearchResult; Session["FullODOResult"] = JsonConvert.DeserializeObject <FlightBookingModel>(JsonConvert.SerializeObject(dumpModel)); Session.Remove("filterParam"); return(RedirectToAction("FlightSearchResult", "FlightSearch", new { tripid })); } #endregion /*20170210 RECEIVE DATA PASSING FROM MAYFLOWER CMS - START */ if (Request.Form["TripTypeCMS"] != null) { model.SearchFlightResultViewModel = new SearchFlightResultViewModel(); DateTime beginDate = DateTime.ParseExact(Request.Form["BeginDateCMS"].ToString(), "dd-MMM-yyyy h:mm:ss tt", null); DateTime endDate = DateTime.ParseExact(Request.Form["EndDateCMS"].ToString(), "dd-MMM-yyyy h:mm:ss tt", null); model.SearchFlightResultViewModel.TripType = Request.Form["TripTypeCMS"].ToString(); model.SearchFlightResultViewModel.DepartureTime = Request.Form["DepartureTimeCMS"].ToString(); model.SearchFlightResultViewModel.ReturnTime = Request.Form["ReturnTimeCMS"].ToString(); model.SearchFlightResultViewModel.DepartureStation = Request.Form["DepartureStationCMS"]?.ToString().ToUpper(); model.SearchFlightResultViewModel.ArrivalStation = Request.Form["ArrivalStationCMS"]?.ToString().ToUpper(); model.SearchFlightResultViewModel.BeginDate = beginDate; model.SearchFlightResultViewModel.EndDate = endDate; model.SearchFlightResultViewModel.PrefferedAirlineCode = Request.Form["PrefferedAirlineCodeCMS"].ToString(); if (model.SearchFlightResultViewModel.PrefferedAirlineCode == "") { model.SearchFlightResultViewModel.PrefferedAirlineCode = null; } model.SearchFlightResultViewModel.PromoCode = Request.Form["PromoCodeCMS"] == null ? null : Request.Form["PromoCodeCMS"].ToString(); model.SearchFlightResultViewModel.Adults = Convert.ToInt32(Request.Form["AdultsCMS"].ToString()); model.SearchFlightResultViewModel.Childrens = Convert.ToInt32(Request.Form["ChildrensCMS"].ToString()); model.SearchFlightResultViewModel.Infants = Convert.ToInt32(Request.Form["InfantsCMS"].ToString()); model.SearchFlightResultViewModel.CabinClass = Request.Form["CabinClassCMS"].ToString(); model.SearchFlightResultViewModel.DirectFlight = Convert.ToBoolean(Request.Form["DirectFlightCMS"].ToString()); model.SearchFlightResultViewModel.IsDynamic = Convert.ToBoolean(Request.Form["IsDynamic"] != null ? Request.Form["IsDynamic"].ToString() : "false"); model.SearchFlightResultViewModel.NoOfRoom = Convert.ToInt32(Request.Form["DynamicRoomCMS"] != null ? Request.Form["DynamicRoomCMS"].ToString() : "1"); model.SearchFlightResultViewModel.IsFixedPrice = Convert.ToBoolean(Request.Form["IsFixedPrice"] != null ? Request.Form["IsFixedPrice"].ToString() : "false"); model.SearchFlightResultViewModel.MarketingMessage = Request.Form["MarketingMessage"]; } /*20170210 RECEIVE DATA PASSING FROM MAYFLOWER CMS - END */ AddFlightSearchCookie(model.SearchFlightResultViewModel); if (searchModel != null && !string.IsNullOrWhiteSpace(searchModel.DepartureStationCode) && searchModel.BeginDate != null) { model.SearchFlightResultViewModel = searchModel; } else { var stateItem = typeof(SearchFlightResultViewModel).GetProperties(); foreach (var item in stateItem) { if (ModelState[item.Name] != null) { ModelState[item.Name].Errors.Clear(); } } } Session[sessionNameBooking] = model; // 0 represent as guest account int userid = User.Identity.IsAuthenticated ? Convert.ToInt32(User.Identity.Name) : 0; try { if (ModelState.IsValid) { if (model.SearchFlightResultViewModel.IsFixedPrice) { return(RedirectToAction("GetFixedHotelSearch", "Hotel", new { tripid })); } else { // 20161126 - For testing next page list flight START return(RedirectToAction("Search", "Flight", new { tripid })); // 20161126 - For testing next page list flight END } } else { return(View(model)); } } catch (Exception ex) { Logger logger = LogManager.GetCurrentClassLogger(); UtilitiesService.NlogExceptionForBookingFlow(logger, model, ex, userid, "HomeSearchFlightError", DateTime.Now.ToString(), ""); return(RedirectToAction("Index", "Home")); } }
public async Task HexColor(int r, int g, int b) => await ReplyAsync(embed : await UtilitiesService.GetHexColorAsync(r, g, b));
public async Task RgbColor(string hexColor) => await ReplyAsync(embed : await UtilitiesService.GetRgbColorAsync(hexColor));
/// <summary> /// Search for a user /// </summary> /// <param name="oHostSecurityToken">HostSecurityToken obtained when security provider of IWS is called</param> /// <param name="collectionRequest"></param> /// <param name="criteria"></param> /// <returns></returns> public UserSearchReturnValue UserSearch(HostSecurityToken oHostSecurityToken, CollectionRequest collectionRequest, UserSearchCriteria criteria) { UserSearchReturnValue returnValue = null; if (Functions.ValidateIWSToken(oHostSecurityToken)) { oUtilitiesService = new UtilitiesService(); returnValue = oUtilitiesService.UserSearch(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest, criteria); } else { returnValue = new UserSearchReturnValue(); returnValue.Success = false; returnValue.Message = "Invalid Token"; } return returnValue; }
private void btnThem_Click(object sender, EventArgs e) { txtMaNhomVatTu.Text = UtilitiesService.AutoGenarateCode(Config.P_NVT); txtTenNhomVatTu.Text = ""; currentNhomVatTu = new NhomVatTu(); }
public ActionResult Hotel(string travelerdata, ProductTourPackage prodTour, string tripid) { CheckoutProduct checkout = (CheckoutProduct)Core.GetSession(Enumeration.SessionName.CheckoutProduct, tripid); int TourPackageID = checkout.TourPackage.TourPackageID; int NoOfPax = checkout.TourPackage.TourPackagesInfo.NoOfPax; var tourProdDetail = checkout.TourPackage.TourPackageDetails; bool isEmptyHotelToken = string.IsNullOrWhiteSpace(travelerdata); List <TourRoomModel> TourRoomPackages = isEmptyHotelToken ? new List <TourRoomModel>() : JsonConvert.DeserializeObject <List <TourRoomModel> >(travelerdata); foreach (var room in TourRoomPackages) { room.RoomTypeName = tourProdDetail.PackageRoomTypes.FirstOrDefault(x => x.RoomTypeID == room.RoomTypeID).RoomTypeName; } checkout.TourPackage.TourPackagesInfo.TourRoomPackages = TourRoomPackages; checkout.TourPackage.TourPackagesInfo.HotelID = TourRoomPackages.FirstOrDefault().hotelID; checkout.TourPackage.TourPackagesInfo.RatingID = tourProdDetail.PackageHotels.FirstOrDefault(x => x.HotelID == checkout.TourPackage.TourPackagesInfo.HotelID).RatingID; List <PeakDates> PeakDateList = GetDates(checkout.TourPackage.TourPackagesInfo.TravelDateFrom, checkout.TourPackage.TourPackagesInfo.TravelDateTo, checkout.TourPackage.TourPackageDetails, checkout.TourPackage.TourPackagesInfo); List <ProductItem> tourproducts = new List <ProductItem>(); tourproducts.Add(new ProductItem() { ItemDetail = tourProdDetail.TourPackageName, ItemQty = NoOfPax, BaseRate = tourProdDetail.SellingPrice, Surcharge = 0, Supplier_TotalAmt = tourProdDetail.Cost * NoOfPax, GST = 0, }); foreach (var room in TourRoomPackages) { var roomdetail = tourProdDetail.PackageRoomTypes.Where(x => x.RoomTypeID == room.RoomTypeID).FirstOrDefault(); tourproducts.Add(new ProductItem() { ItemDetail = roomdetail.RoomTypeName + " room", ItemQty = room.Qty, BaseRate = roomdetail.PackageRoomPrices.FirstOrDefault(x => x.RoomPriceID == room.RoomPriceID).SellingPrice, Surcharge = 0, Supplier_TotalAmt = roomdetail.Cost * room.Qty, GST = 0, }); } if (checkout.TourPackage.TourPackagesInfo.ExtensionNight != 0) { int totalextension = checkout.TourPackage.TourPackagesInfo.ExtensionNight; tourproducts.Add(new ProductItem() { ItemDetail = "Extension", ItemQty = totalextension, BaseRate = tourProdDetail.ExtensionPrice ?? 0, Surcharge = 0, Supplier_TotalAmt = (tourProdDetail.ExtensionPrice ?? 0) * totalextension, GST = 0, }); } if (PeakDateList.Count > 0) { tourproducts.Add(new ProductItem() { ItemDetail = "Peak season surcharge", ItemQty = 1, BaseRate = PeakDateList.FirstOrDefault().PeakSurcharge, Surcharge = 0, Supplier_TotalAmt = PeakDateList.FirstOrDefault().PeakSurcharge, GST = 0, }); } ProductPricingDetail tourPricingDetail = new ProductPricingDetail { Sequence = 5, Currency = "MYR", Items = tourproducts, Discounts = new List <DiscountDetail>(), }; ProductTourPackage producttour = new ProductTourPackage() { TourPackageID = TourPackageID, ContactPerson = checkout.ContactPerson, TourPackageDetails = checkout.TourPackage.TourPackageDetails, TourPackagesInfo = checkout.TourPackage.TourPackagesInfo, ProductSeq = 5, PricingDetail = tourPricingDetail, }; if (checkout.TourPackage != null) { checkout.RemoveProduct(ProductTypes.TP); } checkout.InsertProduct(producttour); var langList = UtilitiesService.GetTourLanguageList(TourPackageID); var entrances = tourProdDetail.EntranceTickets.ToList(); var transportDetail = tourProdDetail.TransportPackages.ToList(); if (!((langList != null && langList.Count > 0) || (entrances != null && entrances.Count > 0) || (transportDetail != null && transportDetail.Count > 0))) { checkout.TourPackage.skipAddon = true; } if (checkout.TourPackage.skipAddon || true) { return(RedirectToAction("Contact", "TourPackage", new { tripid, affiliationId })); } else { return(RedirectToAction("Addon", "TourPackage", new { tripid, affiliationId })); } }