Exemple #1
0
        public List <Models.ViewTag> Get()
        {
            CrowdHeynaEntities db = new CrowdHeynaEntities();
            var tags = new List <Models.ViewTag>();

            //
            foreach (Tag tag in db.Tags.ToList())
            {
                var viewTag = new ViewTag()
                {
                    Id   = tag.Id,
                    Name = tag.Name
                           //
                };
                switch (tag.Id)
                {
                case 1: viewTag.Color = "Red"; break;

                case 2: viewTag.Color = "Green"; break;

                case 3: viewTag.Color = "Blue"; break;

                case 4: viewTag.Color = "Purple"; break;
                }
                tags.Add(viewTag);
            }
            return(tags);
        }
Exemple #2
0
        public void ChangeViewController(ViewTag tag)
        {
            // Does the switch between the diferents views
            switch (tag)
            {
            case ViewTag.ScanView:
                // If it's the first time being called, created it and assign it
                if (scanNC == null)
                {
                    var scanVC = ScanBuyVC.Storyboard.InstantiateViewController("ScanViewControllerID") as ScanViewController;
                    scanVC.NavigationItem.LeftBarButtonItem = btnMenu;
                    scanNC = new UINavigationController(scanVC);
                }

                ScanBuyVC.TopViewController = scanNC;
                break;

            case ViewTag.RecordView:
                if (recordNC == null)
                {
                    var recordVC = ScanBuyVC.Storyboard.InstantiateViewController("RecordViewControllerID") as RecordViewController;
                    recordVC.NavigationItem.LeftBarButtonItem = btnMenu;
                    recordNC = new UINavigationController(recordVC);
                }

                ScanBuyVC.TopViewController = recordNC;
                break;

            default:
                break;
            }

            ScanBuyVC.ResetTopView(true);
        }
Exemple #3
0
        public void AddTag(string tagName)
        {
            var tag = this.InstanciateTag(tagName);

            tag.GroupAscending = true;
            tag.TaskGroup      = TaskGroup.DueDate;

            var viewTag = new ViewTag(this, tag);

            this.databaseContext.AddTag(tag);
            this.tags.Add(viewTag);

            this.TagAdded.Raise(this, new EventArgs <ITag>(viewTag));
        }
        //通过电影ID查找tag
        public List <ViewTag> GetTagByMovie(string MovieID)
        {
            var tags       = context.MovieTag.ToLookup(mt => mt.m_id)[MovieID].ToList();
            var returnList = new List <ViewTag> {
            };

            foreach (var temp in tags)
            {
                var add = new ViewTag
                {
                    TagName = temp.tag_name
                };
                returnList.Add(add);
            }
            return(returnList);
        }
        public static void SelectPaging_xx <TModel>(ViewTag viewTag, SearchEngine se)
            where TModel : InfoBase <TModel>, new()
        {
            if (se == SearchEngine.None)
            {
                return;
            }
            var Interface = viewTag.Interface as TModel;

            var seField = GetSpiderField(se);

            //seField = "BaiduSpiderTotal";//测试

            if (Interface is YellowPage)
            {
                var yp = Interface as YellowPage;
                //return Interface.DataSelectAll("select top 20 * from " + Interface.TableName + " where YellowPageType=" + (int)yp.YellowPageType + " order by "+seField+"");

                var list = Interface.DataSelectPaging("select * from " + Interface.TableName + " where YellowPageType=" + (int)yp.YellowPageType + " and " + seField + "=0 order by id desc", 40, viewTag.PageIndex.Value - 1);//临时使用,运行一段时间后换成上面这句
                viewTag.PagedList = new PagedList <IInfo>(list.Select(item => item as IInfo), list.CurrentPageIndex, list.PageSize, list.TotalItemCount);
            }
            else if (Interface is Recruit)
            {
                var recruit = Interface as Recruit;
                //return Interface.DataSelectAll("select top 20 * from " + Interface.TableName + " where JobType=" + (int)recruit.JobType + " order by "+seField+"");

                var list = Interface.DataSelectPaging("select * from " + Interface.TableName + " where JobType=" + (int)recruit.JobType + " and " + seField + "=0 order by id desc", 40, viewTag.PageIndex.Value - 1);//临时使用,运行一段时间后换成上面这句
                viewTag.PagedList = new PagedList <IInfo>(list.Select(item => item as IInfo), list.CurrentPageIndex, list.PageSize, list.TotalItemCount);
            }
            else if (Interface is JobSeek)
            {
                var jobseek = Interface as JobSeek;
                //return Interface.DataSelectAll("select top 20 * from " + Interface.TableName + " where JobType=" + (int)jobseek.JobType + " order by "+seField+"");

                var list = Interface.DataSelectPaging("select * from " + Interface.TableName + " where JobType=" + (int)jobseek.JobType + " and " + seField + "=0 order by id desc", 40, viewTag.PageIndex.Value - 1);//临时使用,运行一段时间后换成上面这句
                viewTag.PagedList = new PagedList <IInfo>(list.Select(item => item as IInfo), list.CurrentPageIndex, list.PageSize, list.TotalItemCount);
            }
            else
            {
                //return Interface.DataSelectAll("select top 20 * from " + Interface.TableName + " order by "+seField+"");

                if (!Interface.ContainsProperty("IsBiz"))
                {
                    var list = Interface.DataSelectPaging("select * from " + Interface.TableName + " where " + seField + "=0 order by id desc", 40, viewTag.PageIndex.Value - 1);//临时使用,运行一段时间后换成上面这句
                    viewTag.PagedList = new PagedList <IInfo>(list.Select(item => item as IInfo), list.CurrentPageIndex, list.PageSize, list.TotalItemCount);
                }
                else
                {
                    int pageSize = viewTag.IsBiz == null ? 20 : 40;
                    if (viewTag.IsBiz == null)
                    {
                        var listBiz = Interface.DataSelectPaging("select * from " + Interface.TableName + " where " + seField + "=0 and IsBiz=1 order by id desc", pageSize, viewTag.PageIndex.Value - 1);
                        viewTag.PagedListBiz = new PagedList <IInfo>(listBiz.Select(item => item as IInfo), listBiz.CurrentPageIndex, listBiz.PageSize, listBiz.TotalItemCount);

                        var listPersonal = Interface.DataSelectPaging("select * from " + Interface.TableName + " where " + seField + "=0 and IsBiz=0 order by id desc", pageSize, viewTag.PageIndex.Value - 1);
                        viewTag.PagedListPersonal = new PagedList <IInfo>(listPersonal.Select(item => item as IInfo), listPersonal.CurrentPageIndex, listPersonal.PageSize, listPersonal.TotalItemCount);
                    }
                    else if (viewTag.IsBiz == true)
                    {
                        var listBiz = Interface.DataSelectPaging("select * from " + Interface.TableName + " where " + seField + "=0 and IsBiz=1 order by id desc", pageSize, viewTag.PageIndex.Value - 1);
                        viewTag.PagedListBiz = new PagedList <IInfo>(listBiz.Select(item => item as IInfo), listBiz.CurrentPageIndex, listBiz.PageSize, listBiz.TotalItemCount);
                    }
                    else
                    {
                        var listPersonal = Interface.DataSelectPaging("select * from " + Interface.TableName + " where " + seField + "=0 and IsBiz=0 order by id desc", pageSize, viewTag.PageIndex.Value - 1);
                        viewTag.PagedListPersonal = new PagedList <IInfo>(listPersonal.Select(item => item as IInfo), listPersonal.CurrentPageIndex, listPersonal.PageSize, listPersonal.TotalItemCount);
                    }
                }
            }
        }
Exemple #6
0
 public abstract List <BaseNonPersistent> NPGetData(ViewTag tag);