Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public static Dividend ApproveXBRL(int xbrl_id)
        {
            XBRL_SavedFile  xsf = Helper_XBRL_approval.ApproveXBRL0_get_xsFile(xbrl_id);
            XBRL_event_info xei = new XBRL_event_info(xsf.XBRLobj);

            Security sec = SecurityMaster.XBRL_Create_or_Get_Security(xei, true);

            if (sec == null)
            {
                MessageBox.Show("Helper_XBRL error 0: no Security info in either XBRL or Security Master");
                return(null);
            }

            Dividend existing_dvd = Helper_XBRL_approval.ApproveXBRL0_find_existingDividend(xei);

            if (xei.IsCancellation_flag)
            {
                return(Helper_XBRL_approval.ApproveXBRL1_cancellation_XBRL(existing_dvd, xsf));
            }

            Action next_step = XBRL_event_matrix.ApproveXBRL_action(xei, existing_dvd);

            Dividend approved_dvd = null;

            if (next_step == Action.Create_New_Event)
            {
                approved_dvd = Helper_XBRL_approval.ApproveXBRL2_CreateNewDividend(xei, sec);
                Helper_XBRL_approval.ApproveXBRL4_InsertDvdXBRL(xei, approved_dvd);

                if (approved_dvd != null)
                {
                    if (existing_dvd == null)
                    {
                        MessageBox.Show("New Dividend " + approved_dvd.DividendIndex + " created");
                    }
                    else
                    {
                        MessageBox.Show("Another Dividend " + approved_dvd.DividendIndex + " created with existing Dividend " + existing_dvd.DividendIndex);
                    }
                }
            }
            else if (next_step == Action.Update_Existing_event)
            {
                approved_dvd = Helper_XBRL_approval.ApproveXBRL2_UpdateDividend(xei, existing_dvd, sec);
                Helper_XBRL_approval.ApproveXBRL4_InsertDvdXBRL(xei, approved_dvd);

                if (approved_dvd != null)
                {
                    MessageBox.Show("Existing Dividend " + approved_dvd.DividendIndex + " is updated");
                }
            }
            else if (next_step == Action.Add_Ref_to_Current)
            {
                approved_dvd = Helper_XBRL_approval.ApproveXBRL4_InsertDvdXBRL(xei, existing_dvd);

                if (approved_dvd != null)
                {
                    MessageBox.Show("XBRL ref# is added to existing Dividend " + approved_dvd.DividendIndex);
                }
            }

            if (approved_dvd != null)//Mark [XBRL_SavedFile] as approved
            {
                xsf.processState.Value  = 1;
                xsf.DividendIndex.Value = approved_dvd.DividendIndex;
                xsf.Update_to_DB();/*Commented out for testing by Steven if needed*/
            }

            return(approved_dvd);
        }