protected override void OnNavigatedTo(NavigationEventArgs e) { HomeModel homeModel = new HomeModel(); CommonModel.bgImage = homeModel.bgImage; imgBack.Source = homeModel.bgImage; test(); }
public PayUGateway() { this.InitializeComponent(); HomeModel homeModel = new HomeModel(); CommonModel.bgImage = homeModel.bgImage; imgBack.Source = homeModel.bgImage; }
public CreditCardDetails() { this.InitializeComponent(); HomeModel homeModel = new HomeModel(); CommonModel.bgImage = homeModel.bgImage; imgBack.Source = homeModel.bgImage; }
// GET: Home public ActionResult Default() { var model = new HomeModel(); model.GetProducts(); model.GetServices(); return View("Default", model); }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { HomeModel homeModel = new HomeModel(); CommonModel.bgImage = homeModel.bgImage; imgBack.Source = homeModel.bgImage; imgBackBlur.Source = homeModel.bgBlurImage; maxPrice = Convert.ToInt32(txtBMaxPrice.Text); maxTime = Convert.ToInt32(txtBMaxTime.Text); if (e.Parameter is getBusSearch) { var nav = (getBusSearch)e.Parameter; if (nav != null) { lblFromPlace.Text = nav.placeCodeFrom; lblToPlace.Text = nav.placeCodeTo; lblJrnyDate.Text = nav.Date; txtBFromLocationT.Text = nav.Fromplace; txtBToLocationT.Text = nav.Toplace; txtBDateTab.Text = nav.Date; txtBFromCode.Text = nav.placeCodeFrom; txtBFromID.Text = nav.placeIDFrom; txtBToCode.Text = nav.placeCodeTo; txtBToID.Text = nav.placeIDTo; DetailsTap.Visibility = Visibility.Visible; ListMenuItems.Visibility = Visibility.Visible; string d = nav.Date; System.DateTime dt = System.DateTime.ParseExact(d, "dd MMM yyyy", CultureInfo.InvariantCulture); txtBPreDayTab.IsTapEnabled = PreviousDayTab.IsTapEnabled = (dt.Date > System.DateTime.Now.Date); } } else { var nav = pickDropHelper.objGetAvailableService; if (nav != null) { lblFromPlace.Text = nav.placeCodeFrom; lblToPlace.Text = nav.placeCodeTo; lblJrnyDate.Text = nav.journeyDate; txtBFromLocationT.Text = nav.placeNameFrom; txtBToLocationT.Text = nav.placeNameTo; string d1 = nav.journeyDate; System.DateTime dt1 = System.DateTime.ParseExact(d1, "dd/MM/yyyy", CultureInfo.InvariantCulture); txtBDateTab.Text = dt1.ToString("dd MMM yyyy"); txtBFromCode.Text = nav.placeCodeFrom; txtBFromID.Text = nav.placeIDFrom; txtBToCode.Text = nav.placeCodeTo; txtBToID.Text = nav.placeIDto; DetailsTap.Visibility = Visibility.Visible; ListMenuItems.Visibility = Visibility.Visible; string d = txtBDateTab.Text; System.DateTime dt = System.DateTime.ParseExact(d, "dd MMM yyyy", CultureInfo.InvariantCulture); txtBPreDayTab.IsTapEnabled = PreviousDayTab.IsTapEnabled = (dt.Date > System.DateTime.Now.Date); } } postXMLData1(); }
public ActionResult Index() { HomeModel model = new HomeModel(); List<Contact> contactsWithoutLocation = m_ContactStore.GetContactsByLocation(null); var dates = contactsWithoutLocation.GroupBy(c => c.StartTime.Date).Select(grouping => new { Date = grouping.Key, QsoCount = grouping.Count() }).OrderBy(grouping => grouping.Date).Select(grouping => new KeyValuePair<DateTime, int>(grouping.Date, grouping.QsoCount)); model.DatesWithMissingLocations = dates.ToList(); return View(model); }
public IActionResult Index() { _nlog.Info("This is a log direct to nLog"); _commonLog.Info("This is a log to common.logging"); var model = new HomeModel(); model.EnvironmentName = _environment.EnvironmentName; return View(model); }
protected override void OnNavigatedTo(NavigationEventArgs e) { HomeModel homeModel = new HomeModel(); CommonModel.bgImage = homeModel.bgImage; imgBack.Source = homeModel.bgImage; PlaceList m = new PlaceList(); postXMLData1(); }
public BlogModule(Func<IDocumentSession> sessionFactory) { this.RequiresInstallerDisabled(sessionFactory); Get["/"] = parameters => { var model = new HomeModel(); using (IDocumentSession session = sessionFactory()) { int total = 0; int skip = 0; int take = 10; if (parameters.skip.HasValue) { skip = (int) parameters.skip; } if (parameters.take.HasValue) { take = parameters.take; } IEnumerable<BlogPostDto> posts = session.GetPublishedBlogPosts(skip, take, out total); SiteSettings site = session.GetSiteSettings(); if (site == null) return Response.AsText("<h1>Temporarily offline</h1>", "text/html"); model.Title = site.Title; model.SubTitle = site.SubTitle; model.Posts = posts; model.TotalResults = total; } return View[model]; }; Get["/{slug}"] = parameters => { var slug = (string) parameters.slug; using (IDocumentSession session = sessionFactory()) { BlogPostDto post = session.GetPublishedBlogPost(slug); if (post == null) return 404; SiteSettings site = session.GetSiteSettings(); return View["blogpost", new {Post = post, site.Title, SubTitle = post.Title}]; } }; }
public async Task<ActionResult> Index() { var model = new HomeModel(); using (var client = new ApiClient()) { model.Rappers = await client.Send<GetAllRappers, Rapper[]>(new GetAllRappers()); } return View(model); }
public ActionResult Index() { var model = new HomeModel() { PageTitle = "Склад", //CategoryCount = _repository.GetCategoryCount().ToString(CultureInfo.InvariantCulture), //ProductCount = _repository.GetProductCount().ToString(CultureInfo.InvariantCulture), }; return View("Index", model); }
public ActionResult Index() { var model = new HomeModel { LatestEvents = _eventService.LoadEvents(4), Quote = GetQuote(), BrochuresUrl = "http://osf.apphb.com/content/osf%20brochures.pdf" }; return View(model); }
public ActionResult Index() { var bagellers = _bagellerService.FetchAll(); var model = new HomeModel { Bagellers = bagellers, ShoppingList = new ShoppingListModel(BagelShopService.BuildFullShoppingList(bagellers), bagellers) }; return View(model); }
public Test() { this.InitializeComponent(); HomeModel homeModel = new HomeModel(); CommonModel.bgImage = homeModel.bgImage; imgBack.Source = homeModel.bgImage; imgBackBlur.Source = homeModel.bgBlurImage; LayoutRoot.Margin = new Thickness(0, 0, 0, 0); DetailsTap.Visibility = Visibility.Visible; ListMenuItems.Visibility = Visibility.Visible; SliderPrice(); SliderTime(); }
public ActionResult Index() { var model = new HomeModel(); var products = ProductHandler.GetList(false); foreach(var product in products) { var productModel = ProductModelMapper.Map(product); model.Products.Add(productModel); } return View(model); }
public virtual ActionResult Get(string localEducationAgency, int localEducationAgencyId) { // Make sure the metric metadata has been initialized InitializeMetricMetadataCache(); var model = new HomeModel { LocalEducationAgencyInformation = service.Get(HomeRequest.Create(localEducationAgencyId)), Feedback = Feedback("#supportLink", true), }; return View(model); }
public ActionResult Index() { var model = new HomeModel() { ServersCount = _db.Servers.Count(), TenantsCount = _db.Tenants.Count(), JobsCount = _db.Jobs.Count(), StoresCount = _db.Stores.Count(), TerminalsCount = _db.Terminals.Count(), TestTasksCount = _db.TestTasks.Count(), ClientsCount = _db.Clients.Count(), EmployeesCount = _db.Employees.Count(), }; return(View(model)); }
public ActionResult Report(HomeModel model) { var currentUserId = CurrentUserId(); var report = new Report() { ReportProblem = model.ReportBindingModel.ReportProblem, UserId = currentUserId, TweetId = model.ReportBindingModel.TweetId }; this.Data.Reports.Add(report); this.Data.SaveChanges(); TempData["reportmsg"] = "Your request has been successfully send."; return(RedirectToAction("Index", "User")); }
public ActionResult SignUp(HomeModel model) { Context context = CreateContext(); try { int message = this.Services.AddUser(model.User.Login, model.User.Password, model.User.FirstName, model.User.LastName); return(this.RedirectToAction(nameof(HomeController.Index))); } catch (Exception ex) { this.AddError(context.ErrorMessage, ex); return(this.RedirectToAction(nameof(HomeController.Index))); } }
public ActionResult Index() { HomeModel model = new HomeModel(); if (User.Identity.IsAuthenticated) { using (DataContext db = new DataContext()) { var userTasks = db.Tasks.Include("User").Where(t => t.User.UserName.Equals(User.Identity.Name, StringComparison.OrdinalIgnoreCase)).OrderByDescending(t => t.Id).ToList(); model.Tasks = userTasks.Where(t => !t.Completed.HasValue).ToList(); model.ToDoCount = model.Tasks.Count; model.CompletedCount = userTasks.Where(t => t.Completed.HasValue).Count(); } } return(View(model)); }
public async Task <IActionResult> UpdateBio([FromForm] HomeModel form) { if (ModelState.IsValid) { //Better to use dto for this var user = new User { Id = form.UserId, Name = form.Name, Gender = form.Gender ?? 0, BirthDate = form.BirthDate }; await _userRepository.Update(user); } return(RedirectPermanent("/Home/Index")); }
public IActionResult Index(int id) { //id - kategorijas ID var model = new HomeModel(); model.Categories = CategoryManager.GetAll().Select(c => c.ToModel()).ToList(); // precu atlasi no DB, izmantojot ItemManager model.Items = ItemManager.GetByCategory(id).Select(c => c.ToModel()).ToList(); foreach (var cat in model.Categories) { cat.ItemCount = CategoryManager.GetItemCount(cat.Id); } return(View(model)); }
public async Task <MobileResult> DeleteHomeModel([FromBody] HomeModel homeModel) { var mobileResult = new MobileResult(); try { mobileResult = await homeDB.DeleteHomeModel(homeModel); } catch (Exception e) { mobileResult.Data = null; mobileResult.Message = e.Message; mobileResult.Result = false; } return(mobileResult); }
public async Task <IActionResult> Index() { var model = new HomeModel(); if (User.Identity.IsAuthenticated) { var user = await _graphServiceClient.Me.Request().GetAsync(); model.SignInName = user.Id; var userInfo = await _graphServiceClient.Users[user.Id].Request().Select(u => new { u.DisplayName, u.MySite }).GetAsync(); model.DisplayName = userInfo.DisplayName; model.OneDriveUrl = userInfo.MySite; } return(View(model)); }
public LoginController() { M_Login = new LoginModel(); M_Home = new HomeModel(); if (ViewBag.QCAudit == null) { ViewBag.QCAudit = M_Home.GetQcAudit(); } if (ViewBag.PEAudit == null) { ViewBag.PEAudit = M_Home.GetPEAudit(); } res.data = null; res.status = null; }
public ActionResult Index() { if (!Util2.OrgMembersOnly && User.IsInRole("OrgMembersOnly")) { Util2.OrgMembersOnly = true; DbUtil.Db.SetOrgMembersOnly(); } else if (!Util2.OrgLeadersOnly && User.IsInRole("OrgLeadersOnly")) { Util2.OrgLeadersOnly = true; DbUtil.Db.SetOrgLeadersOnly(); } var m = new HomeModel(); return(View(m)); }
public async Task<ActionResult> Index(HomeModel model) { using (var client = new ApiClient()) { model.Rappers = await client.Send<GetAllRappers, Rapper[]>(new GetAllRappers()); if (model.SearchTerm == null) { return View(model); } model.SearchResult = await client.Send<GetRapperByName, Rapper>(new GetRapperByName(model.SearchTerm)); } return View(model); }
// // GET: /HomePage/ public ActionResult Home() { FilmDAO fiDao = new FilmDAO(); AccountDAO accDao = new AccountDAO(); CategoryDAO cDao = new CategoryDAO(); HomeModel home = new HomeModel { MainListFilm = fiDao.GetListFilm(), TopFilm = fiDao.GetTopFilm(5), NewFilm = fiDao.GetTopNewestFilm(5), Account = null, ListCategory = cDao.GetAllCategory(), }; return(View(home)); }
public ActionResult Index() { var vm = new HomeModel(); Contoso.Apps.Movies.Data.Models.User user = (Contoso.Apps.Movies.Data.Models.User)Session["User"]; vm.RecommendProductsTop = RecommendationHelper.GetViaFunction("top", 0, 10); if (user != null) { vm.RecommendProductsBought = RecommendationHelper.GetViaFunction("assoc", user.UserId, 10); vm.RecommendProductsLiked = RecommendationHelper.GetViaFunction("collab", user.UserId, 10); } return(View(vm)); }
public RequestController() { DB_Tapics = new DbTapics(); DB_CCS = new DbCCS(); M_Detail = new DetailModel(); M_Req = new RequestModel(); M_Home = new HomeModel(); if (ViewBag.QCAudit == null) { ViewBag.QCAudit = M_Home.GetQcAudit(); } if (ViewBag.PEAudit == null) { ViewBag.PEAudit = M_Home.GetPEAudit(); } }
public JsonResult getHost(String countyLotId) { String[] countyLot = countyLotId.Split(':'); HomeModel model = new HomeModel(); //assign countyId to search hosts model.countyId = countyLot[0]; //update session when research if (model.searchHostResult.Count() > 0) { Session["HostId"] = model.searchHostResult.ElementAt(0).Value; Session["LotId"] = countyLot[1]; } return(this.Json(model.searchHostResult, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Called when website is loaded, gets JSON data and stores them as objects in the Core project /// </summary> /// <returns></returns> public ActionResult Index() { HomeModel myModel = new HomeModel(); //load JSON file and read text string path = Path.Combine(Server.MapPath("~/Content"), "EquipmentData.json"); string json = System.IO.File.ReadAllText(path); //create list of equipment objects using JSON file SpartanTestSF.Core.EquipmentManager.PopulateEquipmentItems(json); //add equipment objects to model and pass it to view myModel.EquipmentItems = SpartanTestSF.Core.EquipmentManager.GetAllEquipmentItems(); return(View(myModel)); }
public static void Self_IM(object sender, InstantMessageEventArgs e) { if (e.IM.Dialog == InstantMessageDialog.MessageFromAgent) { var hubContext = GlobalHost.ConnectionManager.GetHubContext <ChatHub>(); hubContext.Clients.Group(e.IM.ToAgentID.ToString()).addChatMessage(e.IM.FromAgentName, e.IM.Message, e.IM.FromAgentID.ToString()); HomeModel model = new HomeModel() { slFirstName = e.IM.ToAgentID.ToString(), slLastName = "", FromUsername = e.IM.FromAgentName, Message = e.IM.Message }; sendEmail(model); } }
public IActionResult AddOrder(string address, Guid ArtworkId) { ArtworkModel artworkmodel = _artworkDataManager.GetOneArtwork(ArtworkId); var userId = _userManager.GetUserId(User); UserModel usermodel = _artworkDataManager.GetOneUser(userId); _artworkDataManager.AddOrder(address, artworkmodel, usermodel); _artworkDataManager.EditAvailabilityAfterBuying(ArtworkId); HomeModel homemodel = new HomeModel(); homemodel.Message = "Your Order has been accepted!"; return(RedirectToAction("Index", "Home", homemodel)); }
public IHttpActionResult Index() { var result = new HomeModel() { QuestionsUrl = Url.Link(Config.QuestionsRoute, null), AnswersUrl = Url.Link(Config.AnswersRoute, null), CommentsUrl = Url.Link(Config.CommentsRoute, null), TagsUrl = Url.Link(Config.TagsRoute, null), UsersUrl = Url.Link(Config.UsersRoute, null), SearchUsersUrl = Url.Link(Config.SearchUsersRoute, null), SearchesUrl = Url.Link(Config.SearchesRoute, null), AnnotationsUrl = Url.Link(Config.AnnotationsRoute, null) }; return(Ok(result)); }
public ActionResult Incidents() { ViewBag.AnalyticIncidents = "active"; var service = RestFetcher.Instance; var model = new HomeModel(); model.Braslets = new List <BrasletModel>(); foreach (var device in devices) { var alarmData = service.GetAlarmData(_authCookie, device); var brasletModel = new BrasletModel(); brasletModel.Person = new PersonModel(); if (alarmData != null) { brasletModel.Alarms = alarmData; foreach (var alarm in brasletModel.Alarms) { if (alarm.ExceptionType == "Offline Alarm") { alarm.ExceptionType = "Нет связи"; } if (alarm.ExceptionType == "Exit geofence") { alarm.ExceptionType = "Уход с машрута"; } if (alarm.ExceptionType == "Abnormal blood pressure") { alarm.ExceptionType = "Отклонение кровяного давления"; } if (alarm.ExceptionType == "Enter geofence") { alarm.ExceptionType = "Возвращение на маршрут"; } if (alarm.ExceptionType == "SOS alarm") { alarm.ExceptionType = "SOS"; } } } model.Braslets.Add(brasletModel); } ViewBag.IncidentsActive = "active"; return(View(model)); }
// Umbraco Template // GET: /Home/ public ActionResult Home(RenderModel model) { // Get Model var homeModel = new HomeModel(model.Content, model.CurrentCulture); // Properties // header homeModel.Logo = model.Content.GetPropertyValue <string>("logo"); homeModel.PhoneNumber = model.Content.GetPropertyValue <string>("phoneNumber"); // slider - dont use numbers homeModel.SlideOne = model.Content.GetPropertyValue <string>("slideOne"); homeModel.SlideOneSmall = model.Content.GetPropertyValue <string>("slideOneSmall"); homeModel.SlideTwo = model.Content.GetPropertyValue <string>("slideTwo"); homeModel.SlideTwoSmall = model.Content.GetPropertyValue <string>("slideTwoSmall"); homeModel.SlideThree = model.Content.GetPropertyValue <string>("slideThree"); homeModel.SlideThreeSmall = model.Content.GetPropertyValue <string>("slideThreeSmall"); // main body text homeModel.MainHeading = model.Content.GetPropertyValue <string>("mainHeading"); homeModel.MainBody = model.Content.GetPropertyValue <string>("mainBody"); // services homeModel.ServiceOne = model.Content.GetPropertyValue <string>("serviceOne"); homeModel.ServiceTwo = model.Content.GetPropertyValue <string>("serviceTwo"); homeModel.ServiceThree = model.Content.GetPropertyValue <string>("serviceThree"); homeModel.ServiceFour = model.Content.GetPropertyValue <string>("serviceFour"); // products homeModel.ProductOne = model.Content.GetPropertyValue <string>("productOne"); homeModel.ProductOneHeading = model.Content.GetPropertyValue <string>("productOneHeading"); homeModel.ProductOneText = model.Content.GetPropertyValue <string>("productOneText"); homeModel.ProductTwo = model.Content.GetPropertyValue <string>("productTwo"); homeModel.ProductTwoText = model.Content.GetPropertyValue <string>("productTwoText"); homeModel.ProductThree = model.Content.GetPropertyValue <string>("productThree"); homeModel.ProductThreeText = model.Content.GetPropertyValue <string>("productThreeText"); homeModel.ProductFour = model.Content.GetPropertyValue <string>("productFour"); homeModel.ProductFourText = model.Content.GetPropertyValue <string>("productFourText"); // bundles homeModel.BundleOne = model.Content.GetPropertyValue <string>("bundleOne"); homeModel.BundleTwo = model.Content.GetPropertyValue <string>("bundleTwo"); homeModel.BundleThree = model.Content.GetPropertyValue <string>("bundleThree"); // Changed from View to CurrentTemplate return(CurrentTemplate(homeModel)); }
public ActionResult Index() { var context = new VITVSecondContext(); var today = DateTime.Now.Date; var tomorrow = today.AddDays(1); var userId = User.Identity.GetUserId(); var todayJobs = context.Jobs.Where(j => (!j.StartTime.HasValue || DbFunctions.TruncateTime(j.StartTime.Value) <= today) && j.EndTime.HasValue && DbFunctions.TruncateTime(j.EndTime.Value) >= today && j.Employees.Any(e => e.Id == userId)).ToList(); var tomorrowJobs = context.Jobs.Where(j => (!j.StartTime.HasValue || DbFunctions.TruncateTime(j.StartTime.Value) <= tomorrow) && j.EndTime.HasValue && DbFunctions.TruncateTime(j.EndTime.Value) >= tomorrow && j.Employees.Any(e => e.Id == userId)).ToList(); var model = new HomeModel { TodayJobs = todayJobs, TomorrowJobs = tomorrowJobs }; return(View(model)); }
public ActionResult TaiKhoan(HomeModel model) { if (model.TKQL != null) { ViewBag.dsTK = new AccountModel().getDS(); ViewBag.AddQ = "Đã thêm thành công tài khoản"; if (model.TKQL != null) { var res = new AccountModel().Login(model.TKQL, model.MKQL); if (!res) { new AccountModel().AddQL(model.TKQL, model.MKQL, model.NamHocQL); } } } return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Home", action = "TaiKhoan", Area = "Admin" }))); }
public ActionResult Index() { HomeModel model = new HomeModel(); List <InfoArticleModel> listArticle = dbConnect.GetListInfoArticle(10); int maxCountNew = 5; model.NewArticles = listArticle.Take(maxCountNew).ToList(); if (listArticle.Count > maxCountNew) { model.Articles = listArticle.Skip(maxCountNew).ToList(); } else { model.Articles = new List <InfoArticleModel>(); } return(View(model)); }
public ActionResult Index() { var username = Guid.NewGuid().ToString(); var password = Guid.NewGuid().ToString(); _gate.Dispatch(new SignUpUserCommand(username, password)); _securityUserReader.CheckUserCredentials( new CheckUserCredentialsQuery { Email = username, Password = password }); var model = new HomeModel { Ships = _shipReader.GetAllShips().Select(x => new ShipModel { Id = x.Id, Name = x.Name }).ToList() }; return View(model); }
public IActionResult condominos() { var usuario = new List <UsuariosModelos>(); usuario = HomeModel.AtualUsuario(); ViewBag.buscarAreas = HomeModel.BuscaAreasComuns(); foreach (var item in usuario) { ViewBag.Nome = item.USU_NOME; } return(View()); }
public ActionResult Index(string search) { var albums = db.Albums.Include(a => a.TacGia).Include(a => a.TheLoai).Where(x => x.SoLuong != 0); var AlbumNoiBat = albums.OrderByDescending(x => x.NgayPhatHanh).Where(x => x.SoLuong != 0).Take(4); var AlbumBanChay = albums.OrderByDescending(x => x.DaBan).Where(x => x.SoLuong != 0).Take(3); var carousels = db.Carousels; HomeModel homemodel = new HomeModel { AllAlbum = albums.Take(8).ToList(), AlbumBanChay = AlbumBanChay.ToList(), AlbumNoiBat = AlbumNoiBat.ToList(), Carousels = carousels.ToList() }; return(View(homemodel)); }
public IActionResult Index() { string appHash = Options.MainHash; string vendorHash = Options.VendorHash; string chunkHash = Options.ChunkHash; string polyfillsHash = Options.PolyfillsHash; string frontendHost = Options.ScriptHost; var viewModel = new HomeModel() { VendorScriptUrl = getScriptUrl("vendor.bundle.js", vendorHash, frontendHost), AppScriptUrl = getScriptUrl("main.bundle.js", appHash, frontendHost), ChunksScriptUrl = getScriptUrl("1.chunk.js", chunkHash, frontendHost), PolyfillsScriptUrl = getScriptUrl("polyfills.bundle.js", polyfillsHash, frontendHost) }; return(View(viewModel)); }
public IViewComponentResult Invoke(int userId) { HomeModel model = new HomeModel(); int workspaceId = Convert.ToInt32(HttpContext.Session.GetString("WorkspaceId")); if (workspaceId != 0) { model.Categories = _workspaceService.GetAllCategory(workspaceId, userId); model.Notes = _workspaceService.GetAllNote(model.Categories); model.Workspace = _workspaceService.Get(workspaceId); return(View(model)); } else { return(View(model)); } }
public async Task <ActionResult> Index() { var model = new HomeModel(); /* * We can get the user's info like following or we'll use the extension we created to get user id. * Leaving both here for */ if (Request.IsAuthenticated) { //put a break point and run through following ad check each value for more details. //getting from User.Identity model.UserIdentityUserId = User.Identity.GetUserName(); model.UserIdentityFirstName = User.Identity.GetUserFirstName(); model.UserIdentityLastName = User.Identity.GetUserLastName(); model.UserIdentityId = User.Identity.GetUserId(); //getting the id from the HttpContext extension GetUserId model.HttpContextId = HttpContext.User.Identity.GetUserId(); //get all the thumbnails var thumbnails = await new List <ThumbnailModel>().GetProductThumbnailsAsync(model.HttpContextId); if (thumbnails.Any()) { //thumbnails per area var area = 4; var count = thumbnails.Count() / area; var thumnailsArea = new List <ThumbnailAreaModel>(); for (int i = 0; i <= count; i++) { var areaData = new ThumbnailAreaModel() { Title = i.Equals(0) ? "My Content" : string.Empty, Thumbnails = thumbnails.Skip(i * area).Take(area) }; thumnailsArea.Add(areaData); } model.ThumbnailsArea = new List <ThumbnailAreaModel>(); model.ThumbnailsArea.AddRange(thumnailsArea); } } return(View(model)); }
public ActionResult AddEvenementParcelle(HomeModel model) { Context context = CreateContext(); try { this.Services.AddEvenementParcelle(model.EvenementParcelle); this.AddSuccess("Evenement ajouté."); return(View(model)); } catch (Exception ex) { this.AddError(context.ErrorMessage, ex); return(this.RedirectToAction(nameof(HomeController.AddEvenementParcelle))); } }
public IViewComponentResult Invoke() { var medicine = _context.Medicines.ToList(); var homelist = new List <HomeModel>(); foreach (var item in medicine) { var model = new HomeModel { ImageUrl = "/images/" + item.PictureStr, Name = item.Name, Price = item.Price }; homelist.Add(model); } return(View(homelist)); }
public ActionResult Front() { HomeModel model = new HomeModel { Title = "Netsy front page", TopText = TopText }; model.NetsyControls.Add(new NetsySilverlightModel { Heading = "Etsy front page listings", Params = "Retrieval=FrontListings,ItemsPerPage=16", Width = 660, Height = 560 }); return this.ShowHomeView(model); }
public ActionResult Index(HomeModel model) { if (User.Identity.IsAuthenticated) { //Dictionary<string, string> favs = Favorites.GetFavs(Response); //Module module = CreateHomeModule(); //model.Module = module; //model.Favorites = favs; //SideMenuContent smc = new SideMenuContent(); //SideMenuSection sms = new SideMenuSection(); //sms.Title = "Hello World"; //Dictionary<string, string> smsL1 = new Dictionary<string, string>(); //smsL1.Add("yo dude ima link", "link1"); //smsL1.Add("holy cow me too", "link2"); //sms.Links = smsL1; //SideMenuSection sms2 = new SideMenuSection(); //sms2.Title = "Goodbye World"; //Dictionary<string, string> smsL2 = new Dictionary<string, string>(); //smsL2.Add("yo dude ima link", "link1"); //smsL2.Add("holy cow me too", "link2"); //sms2.Links = smsL2; //List<SideMenuSection> smsList = new List<SideMenuSection>(); //smsList.Add(sms); //smsList.Add(sms2); //smc.Content = smsList; //model.SideMenuContent = smc;//new SideMenuContent(); ////Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("es"); ////Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es"); return RedirectToAction("Status", "Orders"); //return View(model); } else { return RedirectToAction("Login", "Account"); } }
public async Task<ActionResult> Register(RegisterViewModel model) { if (ModelState.IsValid) { var user = new ApplicationUser() { UserName = model.UserName }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { await SignInAsync(user, isPersistent: false); HomeModel TwitterRuRuAccountModel = new HomeModel(); TwitterRuRuAccountModel.AddTwitterRuRuAcc(user.Id); return RedirectToAction("Index", "Home"); } else { AddErrors(result); } } // If we got this far, something failed, redisplay form return View(model); }
public static HomeModel Buid() { HomeModel model = new HomeModel(); model.sliders = PopulateSliders(); return model; }
public ActionResult Sizes() { HomeModel model = new HomeModel { Title = "Netsy front page", TopText = TopText }; model.NetsyControls.Add(new NetsySilverlightModel { Heading = "Wide listings", Params = "Retrieval=FrontListings,ItemsPerPage=4", Height = 140, Width = 660 }); model.NetsyControls.Add(new NetsySilverlightModel { Heading = "Square listings", Params = "Retrieval=FrontListings,ItemsPerPage=4", Height = 290, Width = 330 }); model.NetsyControls.Add(new NetsySilverlightModel { Heading = "Tall listings", Params = "Retrieval=FrontListings,ItemsPerPage=4", Height = 560, Width = 165 }); return this.ShowHomeView(model); }
//MiniProfiler profiler = MiniProfiler.Current; // it's ok if this is null //List<CalendarEvent> db.CalendarEvents = db.CalendarEvents.OrderBy(i => i.Year).ThenBy(i => i.Month).ToList(); // // GET: /Home/ public ActionResult Index() { string press = CultureHelper.GetCurrentNeutralCulture(); switch (press) { case "he": press = db.PressReviews.FirstOrDefault().Heb; break; case "en": press = db.PressReviews.FirstOrDefault().Eng; break; } bool heb = CultureHelper.IsRighToLeft(); StringBuilder sb = new StringBuilder(); string hr = "<hr/>"; foreach (var item in db.HotUpdates.OrderByDescending(i => i.Order)) { sb.Append(heb ? item.Data_Heb : item.Data_Eng).Append(hr); } HomeModel hm = new HomeModel() { Posts = sb.ToString(), Press = press }; return View(model: hm); }
private ActionResult ShowHomeView(HomeModel model) { return this.View("Home", model); }
public ActionResult Index() { var model = new HomeModel(); return View(model); }
public HomeController(IRepository<Beer> beers, IRepository<Brewery> breweries, IRepository<BeerType> beertypes) { model = new HomeModel(beers.DbSet, beertypes.DbSet, breweries.DbSet); }
public HomeModel Index(HomeModel model) { return model; }
public ActionResult Dashboard() { HomeModel model = new HomeModel(); return View("Dashboard", model); }
private Response Index() { var model = new HomeModel(); model.UserName = Context.CurrentUser.UserName; return View["home", model]; }