示例#1
0
        public static string LookupFolderName(int FolderId)
        {
            StockDB.GetFolderDatatable();
            DataRow row1 = StockDB.dtFolder.Rows.Find(FolderId);

            if (row1 != null)
            {
                return(row1["FolderName"].ToString());
            }
            return("");
        }
示例#2
0
        public static void UpdateFolderRow(int FolderId, string FolderName)
        {
            StockDB.dtFolderAllChanged = true;
            DataRow row1 = StockDB.dtFolderAll.Rows.Find(FolderId);

            if (row1 != null)
            {
                row1["FolderName"] = FolderName;
            }
            StockDB.ResetFolderDatabase();
            StockDB.GetFolderDatatable();
        }
示例#3
0
 public static void RecreateFolders()
 {
     StockDB.DeleteRows(StockDB.dtFolderAll, "ParentId = " + 2);
     DataRow[] rowArray1 = StockDB.GetDistinctRows(StockDB.dtSymbolList, "Exchange", "not Code like '^%'");
     DataRow[] rowArray2 = rowArray1;
     for (int num1 = 0; num1 < rowArray2.Length; num1++)
     {
         DataRow row1 = rowArray2[num1];
         StockDB.LoadFolderRow(2, row1["Exchange"].ToString(), false);
     }
     StockDB.ResetFolderDatabase();
     StockDB.GetFolderDatatable();
 }
示例#4
0
        public void AddFolderShortcut()
        {
            DataTable table1 = StockDB.GetFolderDatatable();

            this.RemoveShortcut(ShortcutType.Folder);
            for (int num1 = 0; num1 < table1.Rows.Count; num1++)
            {
                string   text1     = table1.Rows[num1]["FolderId"].ToString();
                string   text2     = table1.Rows[num1]["FolderName"].ToString();
                object[] objArray1 = new object[4] {
                    2, "F" + text2, text1, text2
                };
                this.dtSymbol.Rows.Add(objArray1);
            }
        }
示例#5
0
 private void CreateTree()
 {
     this.tvFolder.BeginUpdate();
     this.Updating = true;
     try
     {
         Hashtable hashtable1 = new Hashtable();
         this.tvFolder.Nodes.Clear();
         DataTable table1 = StockDB.GetFolderDatatable();
         foreach (DataRow row1 in table1.Rows)
         {
             if (((int)row1["Visible"]) != 1)
             {
                 continue;
             }
             TreeNode node1 = new TreeNode(row1["FolderName"].ToString());
             int      num1  = (int)row1["FolderId"];
             int      num2  = (int)row1["ParentId"];
             hashtable1[num1] = node1;
             node1.Tag        = row1;
             if (num2 == 0)
             {
                 this.tvFolder.Nodes.Add(node1);
             }
             else
             {
                 TreeNode node2 = (TreeNode)hashtable1[num2];
                 if (node2 != null)
                 {
                     node1.ImageIndex         = 1;
                     node1.SelectedImageIndex = 1;
                     node2.Nodes.Add(node1);
                 }
             }
             if (ListForm.Current.FolderId == num1)
             {
                 this.tvFolder.SelectedNode = node1;
                 this.CurrentRow            = (DataRow)node1.Tag;
             }
         }
     }
     finally
     {
         this.tvFolder.EndUpdate();
         this.Updating = false;
     }
 }
示例#6
0
        public static int NextFolderId(int FolderId)
        {
            DataTable table1 = StockDB.GetFolderDatatable();
            DataRow   row1   = table1.Rows.Find(FolderId);

            if (row1 != null)
            {
                DataView view1 = new DataView(table1, "ParentId=" + row1["ParentId"], "FolderId", DataViewRowState.CurrentRows);
                int      num1  = view1.Find(FolderId);
                if ((num1 >= 0) && (view1.Count > 0))
                {
                    num1 = ((num1 + 1) + view1.Count) % view1.Count;
                    return((int)view1[num1]["FolderId"]);
                }
            }
            return(0);
        }