public static List <SPR_file> Get_SRP_fileList(HssStatus status, bool all_flag = false) { List <SPR_file> list = new List <SPR_file>(); DB_select selt = new DB_select(SPR_file.Get_cmdTP()); selt.IgnoreColumn("FileBinary"); if (!all_flag) { SQL_relation rela = new SQL_relation("Status", RelationalOperator.Equals, (int)status); selt.SetCondition(rela); } DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { SPR_file sf = new SPR_file(); sf.Init_from_reader(reader); list.Add(sf); } reader.Close(); return(list); }
private static DB_reader Get_DB_reader(HssStatus status, SQL_condition extraCond) { DB_select selt = new DB_select(XBRL_SavedFile.Get_cmdTP()); selt.IgnoreColumn("savedfile"); SQL_relation rela = null; if (status == HssStatus.Pending || status == HssStatus.Approved) { rela = new SQL_relation("processState", RelationalOperator.Equals, (int)status); } else { HashSet <int> hs = new HashSet <int>(); hs.Add(0); hs.Add(1); rela = new SQL_relation("processState", false, hs); } SQL_condition cond = new SQL_condition(rela, ConditionalOperator.And, extraCond); selt.SetCondition(cond); DB_reader reader = new DB_reader(selt, Utility.Get_XBRL_hDB()); return(reader); }
/***********************************************Static Methods******************************************************************/ public static List <XBRL_SavedFile> Get_XBRL_fileList(HssStatus status) { List <XBRL_SavedFile> list = new List <XBRL_SavedFile>(); DB_reader reader = XBRL_SavedFile_master.Get_DB_reader(status, null); while (reader.Read()) { XBRL_SavedFile sf = new XBRL_SavedFile(); sf.Init_from_reader(reader); list.Add(sf); } reader.Close(); return(list); }
public DataTable Get_viewDT(HssStatus status, bool all_flag = false) { this.sourceDT.Clear(); List <SPR_file> list = SPR_fileControl.Get_SRP_fileList(status, all_flag); foreach (SPR_file sf in list) { DataRow row = sourceDT.Rows.Add(); row["ID"] = sf.ID; if (!sf.CreateTime.IsNull_flag) { row["CreateTime"] = sf.CreateTime.Value; } if (Utility.Is_DWRIN_admin()) { row["CreateBy"] = sf.CreateBy.Value; } else { row["CreateBy"] = "System"; } row["FileName"] = sf.FileName.Value; row["CUSIP"] = sf.CUSIP.Value; if (!sf.RecordDate.IsNull_flag) { row["RecordDate"] = sf.RecordDate.Value; } row["SecurityName"] = sf.SecurityName.Value; if (!sf.LastModifyAt.IsNull_flag) { row["LastModifyAt"] = sf.LastModifyAt.Value; } row["LastModifyBy"] = sf.LastModifyBy.Value; row["LastModifyAction"] = sf.LastModifyAction.Value; } return(this.sourceDT); }
public void RefreshData() { HssStatus status = HssStatus.None; if (this.appr_radioButton.Checked) { status = HssStatus.Approved; } else if (this.reject_radioButton.Checked) { status = HssStatus.Rejected; } else { status = HssStatus.Pending; } this.main_ultraGrid.DataSource = this.sf_control.Get_viewDT(status); UltraTextEditor curr_textEditor = null; if (this.appr_radioButton.Checked) { curr_textEditor = this.appr_textEditor; } else if (this.reject_radioButton.Checked) { curr_textEditor = this.rej_textEditor; } else { curr_textEditor = this.pending_textEditor; } this.main_ultraGrid.DisplayLayout.Bands[0].Columns["Action"].EditorComponent = curr_textEditor; this.main_ultraGrid.DisplayLayout.Bands[0].Columns["Action"].ButtonDisplayStyle = ButtonDisplayStyle.Always; this.main_ultraGrid.DisplayLayout.Bands[0].Columns["CreateTime"].Format = UltraGrid_helper.DateTime_format_full; this.main_ultraGrid.DisplayLayout.Bands[0].Columns["LastModifyAt"].Format = UltraGrid_helper.DateTime_format_full; UltraGrid_helper.AutoResize(this.main_ultraGrid); }
/// <summary> /// Invoke by UserControl to retrieve data /// </summary> public void Get_viewDT_async(HssStatus status, SQL_condition extraCond) { if (this.listThread != null) { this.threadStop_flag = true; this.listThread.Join(); } this.sourceDT.Clear();//reset values this.XBRL_list.Clear(); this.currList_id = 0; this.threadStop_flag = false; this.dataFinishedLoading_flag = false; this.curr_reader = XBRL_SavedFile_master.Get_DB_reader(status, extraCond);//create reader for multi-threading this.listThread = new Thread(this.Get_XBRLlist_threadRun); this.listThread.Start(); int loopCount = 0; while (true) { ++loopCount; Thread.Sleep(1); if (this.dataFinishedLoading_flag) { break; } if (this.XBRL_list.Count > 50) { break; } } //Console.WriteLine("---> XBRL_SavedFile_master info 0: loopCount = " + loopCount); this.Add_XBRLrows_to_DT(UltraGrid_helper.RowsLoaded_per_scroll * 2); }
public void SetStatus(HssStatus st) { this.Status.Value = st.ToString(); }