public static DataRow GetFirstRow(string TableName, string Filter) { DataTable[] tableArray1 = StockDB.AllDataBase; for (int num1 = 0; num1 < tableArray1.Length; num1++) { DataTable table1 = tableArray1[num1]; if (string.Compare(table1.TableName, TableName, true) == 0) { StockDB.GetFirstRow(table1, Filter); } } return(null); }
public static DataView GetStockList(int FolderId) { if (StockDB.dtList == null) { StockDB.dtList = StockDB.dtSymbolList.Copy(); StockDB.dtList.BeginLoadData(); StockDB.dtList.Columns.Add("Change", typeof(double)); StockDB.dtList.Columns.Add("Num", typeof(int)); StockDB.dtList.Columns.Add("ChangeP", typeof(double)); StockDB.dtList.Columns.Add("UpDown", typeof(int)); DataColumn[] columnArray1 = new DataColumn[1] { StockDB.dtList.Columns["Code"] }; StockDB.dtList.PrimaryKey = columnArray1; for (int num1 = 0; num1 < StockDB.dtList.Rows.Count; num1++) { DataRow row1 = StockDB.dtList.Rows[num1]; row1["Num"] = num1 + 1; string text1 = row1["Code"].ToString(); StockDB.CalChange(row1); } StockDB.dtList.TableName = "NameList"; StockDB.dtList.EndLoadData(); StockDB.dtList.AcceptChanges(); } DataRow row2 = StockDB.GetFirstRow(StockDB.dtFolderAll, "folderId=" + FolderId); int num2 = 0; if (row2 != null) { num2 = (int)row2["ParentId"]; if (FolderId == 0) { StockDB.currentList = StockDB.dtList.DefaultView; } else if (num2 == 2) { StockDB.currentList = new DataView(StockDB.dtList, "Exchange='" + row2["FolderName"] + "'", "", DataViewRowState.CurrentRows); } else { DataRow[] rowArray1 = StockDB.GetDataRows(StockDB.dtFolderRel, "FolderId=" + FolderId); #if (vs2005) Hashtable hashtable1 = new Hashtable(StringComparer.InvariantCultureIgnoreCase); #else Hashtable hashtable1 = new Hashtable(null, CaseInsensitiveComparer.Default); #endif DataRow[] rowArray2 = rowArray1; for (int num3 = 0; num3 < rowArray2.Length; num3++) { DataRow row3 = rowArray2[num3]; hashtable1[row3[0]] = "1"; } DataTable table1 = StockDB.dtList.Clone(); foreach (DataRow row4 in StockDB.dtList.Rows) { if (hashtable1[row4["Code"]] != null) { table1.Rows.Add(row4.ItemArray); } } StockDB.currentList = table1.DefaultView; } } else { StockDB.currentList = StockDB.dtList.DefaultView; } return(StockDB.currentList); }