private void StartUpdate(HomeDataModel data) { if (data == null) { return; } this.DataContext = data; brB.Visibility = brG.Visibility = brLB.Visibility = brP.Visibility = brR.Visibility = Visibility.Collapsed; switch (data.Color) { case HomeDataModel.BGColor.Blue: brB.Visibility = Visibility.Visible; break; case HomeDataModel.BGColor.Green: brG.Visibility = Visibility.Visible; break; case HomeDataModel.BGColor.LightBlue: brLB.Visibility = Visibility.Visible; break; case HomeDataModel.BGColor.Purpur: brP.Visibility = Visibility.Visible; break; case HomeDataModel.BGColor.Red: brR.Visibility = Visibility.Visible; break; } _startAnimate = data.AnimatePosition; new Thread(ThreadUpdate).Start(); }
/// <summary> /// 公众号首页 /// </summary> /// <returns></returns> public ActionResult Index() { HomeDataModel model = new HomeDataModel(); var owner = GetCurrentUser(); var PlaceIds = GetVerifiedPlaceIds(); //初始化查询条件 var DoorIds = owner.PropertyIdentityVerification.Where(v => v.DoorId != null && v.IsVerified == 1).Select(m => m.DoorId); var CompanyIds = owner.PropertyIdentityVerification.Where(v => v.BuildCompanyId != null && v.IsVerified == 1).Select(m => m.BuildCompanyId); Expression <Func <T_HouseUserExpenseDetails, bool> > where = u => u.IsPayed == ConstantParam.PAYED_FALSE && (DoorIds.Contains(u.BuildDoorId) || CompanyIds.Contains(u.BuildCompanyId)); // 获取当前用户对应业主的缴费记录 IHouseUserExpenseDetailsBLL expenseDetailsBLL = BLLFactory <IHouseUserExpenseDetailsBLL> .GetBLL("HouseUserExpenseDetailsBLL"); model.ExpenseList = expenseDetailsBLL.GetPageList(where, "CreateDate", false, 1, 1).Select(e => new ExpenseNoticeModel { ExpenseType = e.PropertyExpenseType.Name, PlaceName = e.BuildCompanyId == null ? e.BuildDoor.BuildUnit.Build.PropertyPlace.Name : e.BuildCompany.PropertyPlace.Name, OwnerDoor = e.BuildCompanyId == null ? (e.BuildDoor.BuildUnit.Build.BuildName + e.BuildDoor.BuildUnit.UnitName + e.BuildDoor.DoorName) : e.BuildCompany.Name, ExpenseDateDes = e.ExpenseDateDes, Cost = e.Expense + "元" }).ToList(); // 获取用户关联小区的公告列表 IPostBLL postBll = BLLFactory <IPostBLL> .GetBLL("PostBLL"); var placeList = owner.UserPlaces.Select(m => m.PropertyPlaceId); Expression <Func <T_Post, bool> > where1 = u => placeList.Contains(u.PropertyPlaceId) && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT && u.PublishedFlag == ConstantParam.PUBLISHED_TRUE; model.NewsList = postBll.GetPageList(where1, "PublishedTime", false, 1, 3).Select(p => new NewsModel { Id = p.Id, PlaceName = p.PropertyPlace.Name, propertyPic = string.IsNullOrEmpty(p.PropertyPlace.ImgThumbnail) ? "/Images/news_item_default.png" : p.PropertyPlace.ImgThumbnail, PublishTime = p.PublishedTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), Title = p.Title }).ToList(); //获取最新上报的问题 IQuestionBLL questionBll = BLLFactory <IQuestionBLL> .GetBLL("QuestionBLL"); Expression <Func <T_Question, bool> > where2 = u => u.UploadUserId == owner.Id && PlaceIds.Contains(u.PropertyPlaceId); model.QuestionList = questionBll.GetPageList(where2, "Id", false, 1, 2).ToList().Select(q => new QuestionModel { Id = q.Id, PlaceName = q.PropertyPlace.Name, Title = q.Title, Desc = string.IsNullOrEmpty(q.Desc) ? "" : q.Desc, Status = q.Status, UploadTime = q.UploadTime.ToString("yyyy-MM-dd HH:mm:ss"), Imgs = string.IsNullOrEmpty(q.Imgs) ? new string[] { } : q.Imgs.Split(';'), AudioPath = q.AudioPath, VoiceDuration = q.VoiceDuration }).ToList(); return(View(model)); }
// GET: Admin/Home public ActionResult Index() { var model = new HomeDataModel(); model.TotalNewOrderPercent = PercentConvert(model.TotalNewOrderCount, model.TotalOrderCount); model.TotalUserCount = UsersRepository.GetCount(); model.TotalMonthUserCount = UsersRepository.GetCount(true); model.TotalMonthUserPercent = PercentConvert(model.TotalMonthUserCount, model.TotalUserCount); return(View(model)); }
public IActionResult Index() { ViewData["Message"] = "My key val = " + _configuration["AppSecret"]; var list = GetOurServices(); var model = new HomeDataModel(); model.OurServicesList = GetSelectListItems(list); model.CardContentList = list;//GetCardContent(list.Count()); return(View(model)); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { try { HomeDataModel model = (HomeDataModel)this.DataContext; if (model.Image != null && model.Image.Length > 2) { BitmapImage b = new BitmapImage(); b.BeginInit(); b.UriSource = new Uri("/DTCDev.Client.Cars.Service;component/Assets/Images/" + model.Image, UriKind.Relative); b.EndInit(); img.Source = b; } } catch { } }
private void listView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (listView.SelectedItem != null) { var result = (e.CurrentSelection.FirstOrDefault() as HomeDataModel); if (result != null) { nameItem = result; animationView.IsVisible = true; animation.Play(); layoutPage.IsVisible = false; logoanimation.FadeTo(1, 1500); listView.SelectedItem = null; } } }
public UserDataModel(string name, string phone, HomeDataModel home) { this.Name = name; this.Phone = phone; this.Home = home; }
public ItemPage(HomeDataModel nameItem) { InitializeComponent(); this.BindingContext = nameItem; }
public ActionResult Index() { ViewBag.IsFirstPage = true; var mdu = new ProductsModule <ListFilterBase, PRODUCT>(); Dictionary <bool, string> productInfo = mdu.GetProductInfo(); TempData["productInfo"] = productInfo; HomeDataModel model = new HomeDataModel(); Dictionary <int, List <FileViewModel> > productFiles = new Dictionary <int, List <FileViewModel> >(); Dictionary <int, List <FileViewModel> > newstFiles = new Dictionary <int, List <FileViewModel> >(); using (var module = ListFactoryService.Create(ListMethodType.PRODUCT)) { ListViewBase temp = new ListViewBase(); List <PRODUCT> bindProductData = new List <PRODUCT>(); var productResult = (module.DoGetList(temp.Filter) as ListResultBase); foreach (var data in (productResult.Data as List <PRODUCT>).Take(2)) { //取檔案 using (FileModule fileModule = new FileModule()) { var file = fileModule.GetFiles((int)data.ID, "Products"); if (!productFiles.ContainsKey(data.ID)) { productFiles.Add(data.ID, new List <FileViewModel>()); } productFiles[data.ID] = file; } bindProductData.Add(data); } temp.Result.Data = bindProductData; model.Result.Add("Products", temp); } TempData["ProductFiles"] = productFiles; using (var module = ListFactoryService.Create(ListMethodType.NEWS)) { ListViewBase temp = new ListViewBase(); List <NEWS> bindNewsData = new List <NEWS>(); var newResult = (module.DoGetList(temp.Filter) as ListResultBase); foreach (var data in (newResult.Data as List <NEWS>).Take(3)) { data.CONTENT = data.CONTENT = PublicMethodRepository.StripHTML(data.CONTENT).SplitLengthString(60); //取檔案 using (FileModule fileModule = new FileModule()) { var file = fileModule.GetFiles((int)data.ID, "News"); if (!newstFiles.ContainsKey(data.ID)) { newstFiles.Add(data.ID, new List <FileViewModel>()); } newstFiles[data.ID] = file; bindNewsData.Add(data); } } temp.Result.Data = bindNewsData; model.Result.Add("News", temp); } TempData["NewstFiles"] = newstFiles; return(View(model)); }
public IActionResult Index() { HomeDataModel data = new HomeDataModel(); return(View(data)); }
public async Task <IActionResult> Index() { HomeDataModel hdm = new HomeDataModel(_context.Film.ToList()); return(View(hdm)); }