Пример #1
0
        private static DB_reader Get_DB_reader()
        {
            DB_select selt = new DB_select(SavedFiles_CSV.Get_cmdTP());

            selt.IgnoreColumn("SavedFiles_CSV");
            selt.IgnoreColumn("cpuSavedFiles_CSV");
            selt.IgnoreColumn("OriginalSchema");
            selt.IgnoreColumn("OriginalData");

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

            return(reader);
        }
Пример #2
0
        public static List <SavedFiles_CSV> Get_RSH_fileList()
        {
            List <SavedFiles_CSV> list = new List <SavedFiles_CSV>();

            DB_reader reader = SavedFiles_master.Get_DB_reader();

            while (reader.Read())
            {
                SavedFiles_CSV sf = new SavedFiles_CSV();
                sf.Init_from_reader(reader);
                list.Add(sf);
            }
            reader.Close();

            return(list);
        }
Пример #3
0
        public SavedFiles_CSV GetCopy()
        {
            SavedFiles_CSV newEntity = new SavedFiles_CSV();

            if (!this.originalFileName.IsNull_flag)
            {
                newEntity.originalFileName.Value = this.originalFileName.Value;
            }
            //if (!this.SavedFiles_CSV.IsNull_flag) newEntity.SavedFiles_CSV.Value = this.SavedFiles_CSV.Value;
            if (!this.FileCreationDate.IsNull_flag)
            {
                newEntity.FileCreationDate.Value = this.FileCreationDate.Value;
            }
            if (!this.FTP_Source.IsNull_flag)
            {
                newEntity.FTP_Source.Value = this.FTP_Source.Value;
            }
            if (!this.Status.IsNull_flag)
            {
                newEntity.Status.Value = this.Status.Value;
            }
            if (!this.DividendIndex.IsNull_flag)
            {
                newEntity.DividendIndex.Value = this.DividendIndex.Value;
            }
            if (!this.Depositary.IsNull_flag)
            {
                newEntity.Depositary.Value = this.Depositary.Value;
            }
            if (!this.DTC.IsNull_flag)
            {
                newEntity.DTC.Value = this.DTC.Value;
            }
            if (!this.ProcessTime.IsNull_flag)
            {
                newEntity.ProcessTime.Value = this.ProcessTime.Value;
            }
            if (!this.ProcessedBy.IsNull_flag)
            {
                newEntity.ProcessedBy.Value = this.ProcessedBy.Value;
            }
            if (!this.cpuFileName.IsNull_flag)
            {
                newEntity.cpuFileName.Value = this.cpuFileName.Value;
            }
            //if (!this.cpuSavedFiles_CSV.IsNull_flag) newEntity.cpuSavedFiles_CSV.Value = this.cpuSavedFiles_CSV.Value;
            if (!this.cpuStatus.IsNull_flag)
            {
                newEntity.cpuStatus.Value = this.cpuStatus.Value;
            }
            if (!this.cpuProcessTime.IsNull_flag)
            {
                newEntity.cpuProcessTime.Value = this.cpuProcessTime.Value;
            }
            if (!this.cpuProcessedBy.IsNull_flag)
            {
                newEntity.cpuProcessedBy.Value = this.cpuProcessedBy.Value;
            }
            if (!this.OriginalSchema.IsNull_flag)
            {
                newEntity.OriginalSchema.Value = this.OriginalSchema.Value;
            }
            if (!this.OriginalData.IsNull_flag)
            {
                newEntity.OriginalData.Value = this.OriginalData.Value;
            }
            if (!this.RecordDate.IsNull_flag)
            {
                newEntity.RecordDate.Value = this.RecordDate.Value;
            }
            if (!this.Sender.IsNull_flag)
            {
                newEntity.Sender.Value = this.Sender.Value;
            }
            if (!this.CUSIP.IsNull_flag)
            {
                newEntity.CUSIP.Value = this.CUSIP.Value;
            }
            return(newEntity);
        }
Пример #4
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(SavedFiles_CSV.Get_cmdTP());
            if (this.originalFileName.ValueChanged)
            {
                upd.AddValue("originalFileName", this.originalFileName);                                    /*Optional 2*/
            }
            //if (this.SavedFiles_CSV.ValueChanged) upd.AddValue("SavedFiles_CSV", this.SavedFiles_CSV);//no update for binary for now
            if (this.FileCreationDate.ValueChanged)
            {
                upd.AddValue("FileCreationDate", this.FileCreationDate);                                    /*Optional 4*/
            }
            if (this.FTP_Source.ValueChanged)
            {
                upd.AddValue("FTP_Source", this.FTP_Source);                              /*Optional 5*/
            }
            if (this.Status.ValueChanged)
            {
                upd.AddValue("Status", this.Status);                          /*Optional 6*/
            }
            if (this.DividendIndex.ValueChanged)
            {
                upd.AddValue("DividendIndex", this.DividendIndex);                                 /*Optional 7*/
            }
            if (this.Depositary.ValueChanged)
            {
                upd.AddValue("Depositary", this.Depositary);                              /*Optional 8*/
            }
            if (this.DTC.ValueChanged)
            {
                upd.AddValue("DTC", this.DTC);                       /*Optional 9*/
            }
            if (this.ProcessTime.ValueChanged)
            {
                upd.AddValue("ProcessTime", this.ProcessTime);                               /*Optional 10*/
            }
            if (this.ProcessedBy.ValueChanged)
            {
                upd.AddValue("ProcessedBy", this.ProcessedBy);                               /*Optional 11*/
            }
            if (this.cpuFileName.ValueChanged)
            {
                upd.AddValue("cpuFileName", this.cpuFileName);                               /*Optional 12*/
            }
            //if (this.cpuSavedFiles_CSV.ValueChanged) upd.AddValue("cpuSavedFiles_CSV", this.cpuSavedFiles_CSV);//no update for binary for now
            if (this.cpuStatus.ValueChanged)
            {
                upd.AddValue("cpuStatus", this.cpuStatus);                             /*Optional 14*/
            }
            if (this.cpuProcessTime.ValueChanged)
            {
                upd.AddValue("cpuProcessTime", this.cpuProcessTime);                                  /*Optional 15*/
            }
            if (this.cpuProcessedBy.ValueChanged)
            {
                upd.AddValue("cpuProcessedBy", this.cpuProcessedBy);                                  /*Optional 16*/
            }
            if (this.OriginalSchema.ValueChanged)
            {
                upd.AddValue("OriginalSchema", this.OriginalSchema);                                  /*Optional 17*/
            }
            if (this.OriginalData.ValueChanged)
            {
                upd.AddValue("OriginalData", this.OriginalData);                                /*Optional 18*/
            }
            if (this.RecordDate.ValueChanged)
            {
                upd.AddValue("RecordDate", this.RecordDate);                              /*Optional 19*/
            }
            if (this.Sender.ValueChanged)
            {
                upd.AddValue("Sender", this.Sender);                          /*Optional 20*/
            }
            if (this.CUSIP.ValueChanged)
            {
                upd.AddValue("CUSIP", this.CUSIP);                         /*Optional 21*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("id_SavedFiles_CSV", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Пример #5
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(SavedFiles_CSV.Get_cmdTP());

            dbIns.AddValue("originalFileName", this.originalFileName);   /*Optional 2*/
            dbIns.AddValue("SavedFiles_CSV", this.savedfile_csv);
            dbIns.AddValue("FileCreationDate", this.FileCreationDate);   /*Optional 4*/
            dbIns.AddValue("FTP_Source", this.FTP_Source);               /*Optional 5*/
            dbIns.AddValue("Status", this.Status);                       /*Optional 6*/
            dbIns.AddValue("DividendIndex", this.DividendIndex);         /*Optional 7*/
            dbIns.AddValue("Depositary", this.Depositary);               /*Optional 8*/
            dbIns.AddValue("DTC", this.DTC);                             /*Optional 9*/
            dbIns.AddValue("ProcessTime", this.ProcessTime);             /*Optional 10*/
            dbIns.AddValue("ProcessedBy", this.ProcessedBy);             /*Optional 11*/
            dbIns.AddValue("cpuFileName", this.cpuFileName);             /*Optional 12*/
            dbIns.AddValue("cpuSavedFiles_CSV", this.cpu_savedfile_csv); /*Optional 13*/
            dbIns.AddValue("cpuStatus", this.cpuStatus);                 /*Optional 14*/
            dbIns.AddValue("cpuProcessTime", this.cpuProcessTime);       /*Optional 15*/
            dbIns.AddValue("cpuProcessedBy", this.cpuProcessedBy);       /*Optional 16*/
            dbIns.AddValue("OriginalSchema", this.OriginalSchema);       /*Optional 17*/
            dbIns.AddValue("OriginalData", this.OriginalData);           /*Optional 18*/
            dbIns.AddValue("RecordDate", this.RecordDate);               /*Optional 19*/
            dbIns.AddValue("Sender", this.Sender);                       /*Optional 20*/
            dbIns.AddValue("CUSIP", this.CUSIP);                         /*Optional 21*/

            return(dbIns);
        }
Пример #6
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB(bool ignore_binary, bool ignore_SchemaData)
        {
            if (this.id_SavedFiles_CSV < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(SavedFiles_CSV.Get_cmdTP());
            db_sel.tableName = "SavedFiles_CSV";
            if (ignore_binary)
            {
                db_sel.IgnoreColumn("SavedFiles_CSV");
                db_sel.IgnoreColumn("cpuSavedFiles_CSV");
            }
            if (ignore_SchemaData)
            {
                db_sel.IgnoreColumn("OriginalSchema");
                db_sel.IgnoreColumn("OriginalData");
            }

            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("id_SavedFiles_CSV", HssUtility.General.RelationalOperator.Equals, this.id_SavedFiles_CSV);
            db_sel.SetCondition(rela);

            bool res_flag = false;

            HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_XBRL_hDB());
            if (reader.Read())
            {
                this.Init_from_reader(reader);
                res_flag = true;
            }
            reader.Close();
            return(res_flag);
        }