Пример #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;
        }
Пример #2
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);
        }
Пример #3
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);
        }
Пример #4
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);
        }