コード例 #1
0
 public GridPasswordView()
 {
     _Password           = new MobileProperty("Password", "");
     _PasswordType       = new MobileProperty("PasswordType", PwdType.numberPassword);
     _PasswordVisibility = new MobileProperty("PasswordVisibility", false);
     base.RegisterProperties(_Password, _PasswordType, _PasswordVisibility);
 }
コード例 #2
0
        public ActionResult PropertyAdd(MobileProperty model)
        {
            var exist = dbContextService.Exists <MobileProperty>(x => x.Name == model.Name);

            if (exist)
            {
                TempData["errorMsg"] = "该关联配置已经存在!";
                return(View());
            }
            var ret = dbContextService.Add <MobileProperty>(model);

            return(RedirectToAction("PropertyList"));
        }
コード例 #3
0
        public ActionResult PropertyEdit(MobileProperty model)
        {
            var config = dbContextService.Single <MobileProperty>(model.Id);

            config.Name           = model.Name;
            config.BrandId        = model.BrandId;
            config.HardwareId     = model.HardwareId;
            config.ResolutionId   = model.ResolutionId;
            config.Status         = model.Status;
            config.Comment        = model.Comment;
            config.CreateDateTime = DateTime.Now;

            dbContextService.Update <MobileProperty>(config);
            return(RedirectToAction("PropertyList"));
        }
コード例 #4
0
        public IList <WallPaperView> GetLatestWallPaperViewList(MobileParam mobileParams, MobileProperty property, int screenType, int categoryId, int topicId, int subcategoryId, out int totalCount)
        {
            totalCount = 0;

            var wallpaperlist = WallPaperService.GetWallPaperListByScreenType(screenType);
            var wallpaperRelateMobileProperty = WallPaperService.GetWallPaperRelateMobilePropertyList(property.Id);

            if (categoryId == 0 && topicId == 0)
            {
                var wallpaperviewlist = from p in wallpaperlist
                                        join pm in wallpaperRelateMobileProperty on p.Id equals pm.WallPaperId
                                        orderby p.PublishTime descending
                                        select new WallPaperView
                {
                    Id             = p.Id,
                    Title          = p.Title,
                    ThumbnailUrl   = p.ThumbnailName.GetCompleteThumbnailUrl(mobileParams),
                    OriginalUrl    = p.OriginalName.GetCompleteOriginalUrl(mobileParams),
                    DownloadNumber = p.DownloadNumber,
                    PublishTime    = p.PublishTime
                };
                totalCount = wallpaperviewlist.Count();
                return(wallpaperviewlist.ToList());
            }

            if (categoryId == 0 && topicId != 0)
            {
                var wallpaperRelateTopiclist = WallPaperService.GetWallPaperRelateTopicList(topicId);

                var latestwallpaperlistbytopic = from p in wallpaperlist
                                                 join pt in wallpaperRelateTopiclist on p.Id equals pt.WallPaperId
                                                 join pm in wallpaperRelateMobileProperty on p.Id equals pm.WallPaperId
                                                 orderby p.PublishTime descending
                                                 select new WallPaperView
                {
                    Id             = p.Id,
                    Title          = p.Title,
                    ThumbnailUrl   = p.ThumbnailName.GetCompleteThumbnailUrl(mobileParams),
                    OriginalUrl    = p.OriginalName.GetCompleteOriginalUrl(mobileParams),
                    DownloadNumber = p.DownloadNumber,
                    PublishTime    = p.PublishTime
                };
                totalCount = latestwallpaperlistbytopic.Count();
                return(latestwallpaperlistbytopic.ToList());
            }
            if (categoryId != 0)
            {
                var wallpaperRelateCategorylist = WallPaperService.GetWallPaperRelateCategoryList(categoryId);

                var latestwallpaperlistbycategory = from p in wallpaperlist
                                                    join pc in wallpaperRelateCategorylist on p.Id equals pc.WallPaperId
                                                    join pm in wallpaperRelateMobileProperty on p.Id equals pm.WallPaperId
                                                    orderby p.PublishTime descending
                                                    select new WallPaperView
                {
                    Id             = p.Id,
                    Title          = p.Title,
                    ThumbnailUrl   = p.ThumbnailName.GetCompleteThumbnailUrl(mobileParams),
                    OriginalUrl    = p.OriginalName.GetCompleteOriginalUrl(mobileParams),
                    DownloadNumber = p.DownloadNumber,
                    PublishTime    = p.PublishTime
                };
                totalCount = latestwallpaperlistbycategory.Count();
                return(latestwallpaperlistbycategory.ToList());
            }
            return(new List <WallPaperView>());
        }