Example #1
0
/// <summary>
/// Update collection of temp lists
/// </summary>
/// <param name="uo"></param>

        public static void UpdateTempListCollection(UserObject uo)
        {
            if (Lex.Ne(uo.ParentFolder, UserObject.TempFolderName))
            {
                return;                                                                 // update for lists in temp folder only
            }
            List <TempCidList> tLists = SS.I.TempCidLists;
            TempCidList        tl     = null;
            int tli;

            for (tli = 0; tli < tLists.Count; tli++)
            {
                tl = tLists[tli];
                if (Lex.Eq(tl.Name, uo.Name))
                {
                    break;
                }
            }

            if (tli >= tLists.Count)
            {
                tl = new TempCidList();
                tLists.Add(tl);
            }

            tl.Name  = uo.Name;
            tl.Count = uo.Count;
            tl.Id    = uo.Id;
            return;
        }
Example #2
0
        private void Combine_Click(object sender, EventArgs e)
        {
            ListLogicType op;

            MetaTreeNode mtn1 = GetListMetaTreeNode(ListTree1.TreeList.FocusedNode);

            if (mtn1 == null)
            {
                return;
            }

            MetaTreeNode mtn2 = GetListMetaTreeNode(ListTree2.TreeList.FocusedNode);

            if (mtn2 == null)
            {
                return;
            }

            if (ListAnd.Checked)
            {
                op = ListLogicType.Intersect;
            }
            else if (ListOr.Checked)
            {
                op = ListLogicType.Union;
            }
            else
            {
                op = ListLogicType.Difference;
            }
            int count = CidListDao.ExecuteListLogic(mtn1.Target, mtn2.Target, op);

            UserObject  uo = CidListCommand.ReadCurrentListHeader();
            TempCidList tl = CidListCommand.GetTempList("Current");

            if (uo != null && tl != null)
            {
                tl.Count = uo.Count;
                tl.Id    = uo.Id;
            }

            UpdateNode("Current");             // refresh the node to show the new count

            StatusMessage.Caption = count + " " + MetaTable.PrimaryKeyColumnLabel +
                                    "s have passed the combine and have been saved in *Current";

            SessionManager.CurrentResultKeys = CidListCommand.ReadCurrentListRemote().ToStringList();
            SessionManager.DisplayCurrentCount();
            return;
        }
Example #3
0
/// <summary>
/// Get a temp list by name
/// </summary>
/// <param name="listName"></param>
/// <returns></returns>

        public static TempCidList GetTempList(string listName)
        {
            List <TempCidList> tLists = SS.I.TempCidLists;

            for (int tli = 0; tli < tLists.Count; tli++)
            {
                TempCidList tl = tLists[tli];
                if (Lex.Eq(tl.Name, listName))
                {
                    return(tl);
                }
            }

            return(null);
        }