Esempio n. 1
0
        public static List <DividendXBRL> GetList_refNo(string refNo)
        {
            List <DividendXBRL> dxList = new List <DividendXBRL>();

            if (string.IsNullOrEmpty(refNo))
            {
                return(dxList);
            }

            DB_select    selt = new DB_select(DividendXBRL.Get_cmdTP());
            SQL_relation rela = new SQL_relation("XBRL_ReferenceNumber", RelationalOperator.Equals, refNo);

            selt.SetCondition(rela);

            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                DividendXBRL dx = new DividendXBRL();
                dx.Init_from_reader(reader);
                dxList.Add(dx);
            }
            reader.Close();

            return(dxList);
        }
Esempio n. 2
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(DividendXBRL.Get_cmdTP());
            if (this.DividendIndex.ValueChanged)
            {
                upd.AddValue("DividendIndex", this.DividendIndex);
            }
            if (this.Depositary.ValueChanged)
            {
                upd.AddValue("Depositary", this.Depositary);                              /*Optional 3*/
            }
            if (this.XBRL_ReferenceNumber.ValueChanged)
            {
                upd.AddValue("XBRL_ReferenceNumber", this.XBRL_ReferenceNumber);
            }
            if (this.PSAFE.ValueChanged)
            {
                upd.AddValue("PSAFE", this.PSAFE);                         /*Optional 5*/
            }
            if (this.LastModifiedDate.ValueChanged)
            {
                upd.AddValue("LastModifiedDate", this.LastModifiedDate);                                    /*Optional 6*/
            }
            if (this.SourceType.ValueChanged)
            {
                upd.AddValue("SourceType", this.SourceType);                              /*Optional 7*/
            }
            if (this.LastModifiedBy.ValueChanged)
            {
                upd.AddValue("LastModifiedBy", this.LastModifiedBy);                                  /*Optional 8*/
            }
            if (this.Announcement_Identifier.ValueChanged)
            {
                upd.AddValue("Announcement Identifier", this.Announcement_Identifier);                                           /*Optional 9*/
            }
            if (this.Event_Completeness.ValueChanged)
            {
                upd.AddValue("Event Completeness", this.Event_Completeness);                                      /*Optional 10*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("XBRL_ID", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Esempio n. 3
0
        public DividendXBRL GetCopy()
        {
            DividendXBRL newEntity = new DividendXBRL();

            if (!this.DividendIndex.IsNull_flag)
            {
                newEntity.DividendIndex.Value = this.DividendIndex.Value;
            }
            if (!this.Depositary.IsNull_flag)
            {
                newEntity.Depositary.Value = this.Depositary.Value;
            }
            if (!this.XBRL_ReferenceNumber.IsNull_flag)
            {
                newEntity.XBRL_ReferenceNumber.Value = this.XBRL_ReferenceNumber.Value;
            }
            if (!this.PSAFE.IsNull_flag)
            {
                newEntity.PSAFE.Value = this.PSAFE.Value;
            }
            if (!this.LastModifiedDate.IsNull_flag)
            {
                newEntity.LastModifiedDate.Value = this.LastModifiedDate.Value;
            }
            if (!this.SourceType.IsNull_flag)
            {
                newEntity.SourceType.Value = this.SourceType.Value;
            }
            if (!this.LastModifiedBy.IsNull_flag)
            {
                newEntity.LastModifiedBy.Value = this.LastModifiedBy.Value;
            }
            if (!this.Announcement_Identifier.IsNull_flag)
            {
                newEntity.Announcement_Identifier.Value = this.Announcement_Identifier.Value;
            }
            if (!this.Event_Completeness.IsNull_flag)
            {
                newEntity.Event_Completeness.Value = this.Event_Completeness.Value;
            }
            return(newEntity);
        }
Esempio n. 4
0
        public static DividendXBRL Get_dvdXBRL(string refNo, int dvdIndex)
        {
            DB_select    selt  = new DB_select(DividendXBRL.Get_cmdTP());
            SQL_relation rela0 = new SQL_relation("XBRL_ReferenceNumber", RelationalOperator.Equals, refNo);
            SQL_relation rela1 = new SQL_relation("DividendIndex", RelationalOperator.Equals, dvdIndex);

            selt.SetCondition(new SQL_condition(rela0, ConditionalOperator.And, rela1));

            DividendXBRL dx     = null;
            DB_reader    reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            if (reader.Read())
            {
                dx = new DividendXBRL();
                dx.Init_from_reader(reader);
            }
            reader.Close();

            return(dx);
        }
Esempio n. 5
0
        public static List <DividendXBRL> GetList_dvdIndex(int dvdIndex)
        {
            List <DividendXBRL> dxList = new List <DividendXBRL>();

            DB_select    selt = new DB_select(DividendXBRL.Get_cmdTP());
            SQL_relation rela = new SQL_relation("DividendIndex", RelationalOperator.Equals, dvdIndex);

            selt.SetCondition(rela);

            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                DividendXBRL dx = new DividendXBRL();
                dx.Init_from_reader(reader);
                dxList.Add(dx);
            }
            reader.Close();

            return(dxList);
        }
Esempio n. 6
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.XBRL_ID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(DividendXBRL.Get_cmdTP());
            db_sel.tableName = "Dividend_XBRL";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("XBRL_ID", HssUtility.General.RelationalOperator.Equals, this.XBRL_ID);
            db_sel.SetCondition(rela);

            bool res_flag = false;

            HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_DRWIN_hDB());
            if (reader.Read())
            {
                this.Init_from_reader(reader);
                res_flag = true;
            }
            reader.Close();
            return(res_flag);
        }
Esempio n. 7
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(DividendXBRL.Get_cmdTP());

            dbIns.AddValue("DividendIndex", this.DividendIndex);
            dbIns.AddValue("Depositary", this.Depositary);                           /*Optional 3*/
            dbIns.AddValue("XBRL_ReferenceNumber", this.XBRL_ReferenceNumber);
            dbIns.AddValue("PSAFE", this.PSAFE);                                     /*Optional 5*/
            dbIns.AddValue("LastModifiedDate", this.LastModifiedDate);               /*Optional 6*/
            dbIns.AddValue("SourceType", this.SourceType);                           /*Optional 7*/
            dbIns.AddValue("LastModifiedBy", this.LastModifiedBy);                   /*Optional 8*/
            dbIns.AddValue("Announcement Identifier", this.Announcement_Identifier); /*Optional 9*/
            dbIns.AddValue("Event Completeness", this.Event_Completeness);           /*Optional 10*/

            return(dbIns);
        }