public ActionResult List(string urlparam) { List <Tour> tours = ReturnTourList(urlparam); TourListViewModel tourListViewModel = new TourListViewModel(); tourListViewModel.Menu = menu.ReturnMenuTours(); tourListViewModel.Tours = tours; tourListViewModel.MenuBlogGroups = menu.ReturnBlogGroups(); TourCategory tourCategory = db.TourCategories.Include(current => current.Parent) .FirstOrDefault(current => current.UrlParam == urlparam); tourListViewModel.TourCategory = tourCategory; tourListViewModel.Footer = menu.ReturnFooter(); ViewBag.Canonical = "https://www.bektashtravel.com/tour/" + urlparam; tourListViewModel.SidebarVisaList = GetSideBarVisaList(); tourListViewModel.SidebarTourCategories = GetSideBarTourCategory(); if (tours == null) { return(RedirectPermanent("/tour")); } return(View(tourListViewModel)); }
public IActionResult Form(TourListViewModel t) { if (ModelState.IsValid) { t.TourGroup.TourTime = GroupTime; context.Group.Add(t.TourGroup); Times.Remove(Convert.ToDateTime(GroupTime)); context.SaveChanges(); return(View("ViewApps", context.Group)); } else { return(View(new TourListViewModel { TourGroup = new TourGroup(), Time = GroupTime })); } }
public object CreateViewModel(DependencyObject sender) { IWindowFactory windowFactorySave = new AddTourWindowFactory(); IWindowFactory windowFactoryEdit = new EditTourWindowFactory(); IWindowFactory windowFactoryDelete = new DeleteTourWindowFactory(); IWindowFactory windowFactoryImport = new ImportToursWindowFactory(); TourListViewModel vm = new TourListViewModel(windowFactorySave, windowFactoryEdit, windowFactoryDelete, windowFactoryImport); ITourDal tourDal = new TourDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ITourService>(new TourService(tourDal)); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); vm.ServiceLocator.RegisterService <IMapService>(new MapquestService(ConfigurationManager.AppSettings["base_directory"])); vm.ServiceLocator.RegisterService <IReportService>(new PdfReportService(ConfigurationManager.AppSettings["base_directory"], $"{ConfigurationManager.AppSettings["download_directory"]}Reports\\")); ObserverSingleton.GetInstance.TourObservers.Add(vm); return(vm); }
public ViewResult List(int format = 0, string query = null, string type = null) { TourListViewModel model = new TourListViewModel { Tours = repository.GetAllTours() .Where(b => format == 0 || b.Format.FormatId == format) .Where(b => type == null || b.Type == type) .Where(b => query == null || b.Name == query || b.Description == query), Types = repository.GetAllTours() .Select(tour => tour.Type) .Distinct() .OrderBy(x => x), Formats = formatRepository.GetAllFormats(), CurentFormat = format, CurentType = type }; return(View(model)); }
public ActionResult SpecialList(string urlparam) { TourListViewModel tourListViewModel = new TourListViewModel(); tourListViewModel.Menu = menu.ReturnMenuTours(); tourListViewModel.Tours = ReturnSpecialTourList(); tourListViewModel.MenuBlogGroups = menu.ReturnBlogGroups(); tourListViewModel.TourCategory = db.TourCategories.Include(current => current.Parent) .FirstOrDefault(current => current.UrlParam == urlparam); tourListViewModel.Footer = menu.ReturnFooter(); tourListViewModel.SidebarVisaList = GetSideBarVisaList(); tourListViewModel.SidebarTourCategories = GetSideBarTourCategory(); ViewBag.Canonical = "https://www.bektashtravel.com/تور-نوروز"; ViewBag.Description = "بکتاش سیر ارائه دهنده تورهای نوروز 99 با بهترین قیمت. جهت مشاهده تورهای متنوع و اطلاع از قیمت های تورها به وب سایت بکتاش سیر یا با شماره تلفن 02157952 تماس بگیرید."; ViewBag.Title = "تورهای نوروز 99 در بکتاش سیر"; return(View(tourListViewModel)); }
public ActionResult PureList() { TourListViewModel tourListViewModel = new TourListViewModel(); tourListViewModel.Menu = menu.ReturnMenuTours(); tourListViewModel.Tours = ReturnTourList(null); tourListViewModel.MenuBlogGroups = menu.ReturnBlogGroups(); tourListViewModel.Footer = menu.ReturnFooter(); tourListViewModel.SidebarVisaList = GetSideBarVisaList(); tourListViewModel.SidebarTourCategories = GetSideBarTourCategory(); ViewBag.Canonical = "https://www.bektashtravel.com/tour/"; ViewBag.Description = "بکتاش سیر ارائه دهنده تورهای متنوع آسیایی و اروپایی و تور کانادا. جهت مشاهده تورهای متنوع و اطلاع از قیمت های تورها به وب سایت بکتاش سیر یا با شماره تلفن 02157952 تماس بگیرید."; ViewBag.Title = "تورهای آسیایی و اروپایی و تور کانادا بکتاش سیر"; return(View(tourListViewModel)); }
public TourList() { InitializeComponent(); BindingContext = viewModel = new TourListViewModel(); }