Example #1
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - XBRLfield_master.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            XBRLfield_master.Reset();
            DB_select selt   = new DB_select(XBRLfield.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                XBRLfield xf = new XBRLfield();
                xf.Init_from_reader(reader);

                XBRLfield_master.id_dic[xf.id_XBRLField]            = xf;
                XBRLfield_master.drwin_dic[xf.drwinFieldName.Value] = xf;
            }
            reader.Close();

            XBRLfield_master.lastUpdateTime = DateTime.Now;
        }
Example #2
0
        public XBRLfield GetCopy()
        {
            XBRLfield newEntity = new XBRLfield();

            if (!this.xbrlElement.IsNull_flag)
            {
                newEntity.xbrlElement.Value = this.xbrlElement.Value;
            }
            if (!this.xbrlAttributeName.IsNull_flag)
            {
                newEntity.xbrlAttributeName.Value = this.xbrlAttributeName.Value;
            }
            if (!this.xbrlContextRefValue.IsNull_flag)
            {
                newEntity.xbrlContextRefValue.Value = this.xbrlContextRefValue.Value;
            }
            if (!this.NameSpace.IsNull_flag)
            {
                newEntity.NameSpace.Value = this.NameSpace.Value;
            }
            if (!this.drwinFieldName.IsNull_flag)
            {
                newEntity.drwinFieldName.Value = this.drwinFieldName.Value;
            }
            if (!this.drwinControlType.IsNull_flag)
            {
                newEntity.drwinControlType.Value = this.drwinControlType.Value;
            }
            if (!this.multiple.IsNull_flag)
            {
                newEntity.multiple.Value = this.multiple.Value;
            }
            if (!this.active.IsNull_flag)
            {
                newEntity.active.Value = this.active.Value;
            }
            if (!this.chkCompleteness.IsNull_flag)
            {
                newEntity.chkCompleteness.Value = this.chkCompleteness.Value;
            }
            if (!this.drwinFieldNameIncomplete.IsNull_flag)
            {
                newEntity.drwinFieldNameIncomplete.Value = this.drwinFieldNameIncomplete.Value;
            }
            if (!this.drwinFieldNameComplete.IsNull_flag)
            {
                newEntity.drwinFieldNameComplete.Value = this.drwinFieldNameComplete.Value;
            }
            if (!this.createdDate.IsNull_flag)
            {
                newEntity.createdDate.Value = this.createdDate.Value;
            }
            if (!this.createdBy.IsNull_flag)
            {
                newEntity.createdBy.Value = this.createdBy.Value;
            }
            if (!this.overridable.IsNull_flag)
            {
                newEntity.overridable.Value = this.overridable.Value;
            }
            return(newEntity);
        }
Example #3
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(XBRLfield.Get_cmdTP());
            if (this.xbrlElement.ValueChanged)
            {
                upd.AddValue("xbrlElement", this.xbrlElement);
            }
            if (this.xbrlAttributeName.ValueChanged)
            {
                upd.AddValue("xbrlAttributeName", this.xbrlAttributeName);
            }
            if (this.xbrlContextRefValue.ValueChanged)
            {
                upd.AddValue("xbrlContextRefValue", this.xbrlContextRefValue);
            }
            if (this.NameSpace.ValueChanged)
            {
                upd.AddValue("namespace", this.NameSpace);
            }
            if (this.drwinFieldName.ValueChanged)
            {
                upd.AddValue("drwinFieldName", this.drwinFieldName);
            }
            if (this.drwinControlType.ValueChanged)
            {
                upd.AddValue("drwinControlType", this.drwinControlType);
            }
            if (this.multiple.ValueChanged)
            {
                upd.AddValue("multiple", this.multiple);
            }
            if (this.active.ValueChanged)
            {
                upd.AddValue("active", this.active);
            }
            if (this.chkCompleteness.ValueChanged)
            {
                upd.AddValue("chkCompleteness", this.chkCompleteness);
            }
            if (this.drwinFieldNameIncomplete.ValueChanged)
            {
                upd.AddValue("drwinFieldNameIncomplete", this.drwinFieldNameIncomplete);
            }
            if (this.drwinFieldNameComplete.ValueChanged)
            {
                upd.AddValue("drwinFieldNameComplete", this.drwinFieldNameComplete);
            }
            if (this.createdDate.ValueChanged)
            {
                upd.AddValue("createdDate", this.createdDate);
            }
            if (this.createdBy.ValueChanged)
            {
                upd.AddValue("createdBy", this.createdBy);
            }
            if (this.overridable.ValueChanged)
            {
                upd.AddValue("overridable", this.overridable);
            }

            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("id_XBRLField", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Example #4
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(XBRLfield.Get_cmdTP());

            dbIns.AddValue("xbrlElement", this.xbrlElement.Value);
            dbIns.AddValue("xbrlAttributeName", this.xbrlAttributeName);               /*Optional 3*/
            dbIns.AddValue("xbrlContextRefValue", this.xbrlContextRefValue);           /*Optional 4*/
            dbIns.AddValue("namespace", this.NameSpace);                               /*Optional 5*/
            dbIns.AddValue("drwinFieldName", this.drwinFieldName);                     /*Optional 6*/
            dbIns.AddValue("drwinControlType", this.drwinControlType);                 /*Optional 7*/
            dbIns.AddValue("multiple", this.multiple);                                 /*Optional 8*/
            dbIns.AddValue("active", this.active);                                     /*Optional 9*/
            dbIns.AddValue("chkCompleteness", this.chkCompleteness);                   /*Optional 10*/
            dbIns.AddValue("drwinFieldNameIncomplete", this.drwinFieldNameIncomplete); /*Optional 11*/
            dbIns.AddValue("drwinFieldNameComplete", this.drwinFieldNameComplete);     /*Optional 12*/
            dbIns.AddValue("createdDate", this.createdDate.Value);
            dbIns.AddValue("createdBy", this.createdBy.Value);
            dbIns.AddValue("overridable", this.overridable);/*Optional 15*/

            return(dbIns);
        }
Example #5
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.id_XBRLField < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(XBRLfield.Get_cmdTP());
            db_sel.tableName = "XBRLField";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("id_XBRLField", HssUtility.General.RelationalOperator.Equals, this.id_XBRLField);
            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);
        }