private void XBRL_button_Click(object sender, EventArgs e) { int id_savedFile = (int)this.XBRL_numericUpDown.Value; XBRL_SavedFile sf = new XBRL_SavedFile(id_savedFile); sf.Init_from_DB(false); XBRL_event_info xei = new XBRL_event_info(sf.savedfile); Security sec = SecurityMaster.XBRL_Create_or_Get_Security(xei, false); Dividend dvd = new Dividend(); dvd.Init_from_XBRL(xei, sec); dvd.PrintAllAttributeValues(); }
private void uploadXBRL_button_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { string filePath = ofd.FileName; FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); fs.Close(); XBRL_SavedFile xsf = new XBRL_SavedFile(); xsf.savedfile = buffer; xsf.Init_from_info(new XBRL_event_info(buffer)); xsf.originalFileName.Value = filePath.Substring(filePath.LastIndexOf('\\') + 1); MessageBox.Show(xsf.originalFileName.Value + " (" + xsf.Insert_to_DB() + ")"); this.RefreshData(null); } }
/// <summary> /// Action column event handler /// </summary> private void ActionButtonEvent_textEditor(object sender, EditorButtonEventArgs e) { if (e.Context is UltraGridCell == false) { return; } UltraGridCell cell = (UltraGridCell)e.Context; int ID = (int)cell.Row.Cells["id_SavedfilesRcvd"].Value; XBRL_SavedFile sf = new XBRL_SavedFile(ID); string option = e.Button.Key; if (option.StartsWith("Approve", StringComparison.OrdinalIgnoreCase)) { if (MessageBox.Show("Approve file " + ID + "?", "Happy!", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } Dividend dvd = Helper_XBRL_approval.ApproveXBRL(ID); this.RefreshData(null); if (dvd != null && MessageBox.Show("Go to Control? " + dvd.DividendIndex, "???", MessageBoxButtons.YesNo) == DialogResult.Yes) { this.GoToControl_func(dvd.DividendIndex); } } else if (option.StartsWith("ViewData", StringComparison.OrdinalIgnoreCase)) { sf.Init_from_DB(false); ViewDataForm vdf = new ViewDataForm(); vdf.suggestedFileName_forSave = sf.id_SavedfilesRcvd.ToString(); vdf.Set_grid_dataSource(sf.Get_XBRLinfo_DS()); vdf.Set_notePad_dataSource(sf.savedfile); vdf.Show(); } else if (option.StartsWith("Reject", StringComparison.OrdinalIgnoreCase)) { if (MessageBox.Show("Reject file " + ID + "?", "Sad...", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } sf.Init_from_DB(true); sf.processState.Value = (int)HssStatus.Rejected; sf.Update_to_DB(); this.lastRefreshAt = DateTime.MinValue; this.RefreshData(null); } else if (option.StartsWith("Restore", StringComparison.OrdinalIgnoreCase)) { if (MessageBox.Show("Restore file " + ID + "?", "Hero is back!", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } sf.Init_from_DB(true); sf.processState.Value = (int)HssStatus.Pending; sf.Update_to_DB(); this.lastRefreshAt = DateTime.MinValue; this.RefreshData(null); } }