//public void buildInstrumentInfo()
        //{ 
        //    //this.xmlDoc_.LoadXml(this.InstrumentXml_);

        //    this.InstrumentType_ = "testType";
        //    this.InstrumentCode_ = "testCode";
        //    this.ReferenceDate_ = "testRefDate";
        //}

        public override void DoJob()
        {
            //this.buildInstrumentInfo();

            // db queue insert

            CALCULATION_QUEUE_INFO_Table_DAO dao = new CALCULATION_QUEUE_INFO_Table_DAO();

            GridCalculationViewModel gcvm = this.MessageViewModel_.MessageBodyViewModel_ as GridCalculationViewModel;

            dao.INST_CODE_ = gcvm.Inst_code_;
            dao.INST_NAME_ = gcvm.Inst_name_;
            dao.INST_TYPE_ = gcvm.Inst_type_;
            dao.PARA_DATE_ = gcvm.Para_refDate_;

            dao.CALCULATION_STATE_ = "regist";

            string connectionStr = DataBaseConnectManager.ConnectionString_;

            if (dao.CALCULATION_STATE_ == "regist")
            {
                dao.insert(DataBaseConnectManager.ConnectionFactory("sqlCe",connectionStr));
                File.WriteAllText(gcvm.Inst_code_ + ".xml", gcvm.InnerXml_);
            }
            else if (dao.CALCULATION_STATE_ == "deRegist")
            {
                dao.delete(DataBaseConnectManager.ConnectionFactory("sqlCe",connectionStr));
            }
            else
            {

            }


            //string fileName = this.InstrumentCode_;

            //File.WriteAllText(fileName, this.InstrumentXml_);

            //Console.WriteLine("File Saved. , name : {0} : ", fileName);

            //AsynchronousSocketListener.InstrumentQueue_.Enqueue(this);


        }
        public void select(DbConnection conn)
        {
            if (conn.State != ConnectionState.Open)
                conn.Open();

            DataTable tb = new DataTable();

            this.DAOList_ = new List<CALCULATION_QUEUE_INFO_Table_DAO>();

            DbCommand dbCommand = conn.CreateCommand();

            string selectQuery = CALCULATION_QUEUE_INFO_Table_DAOManager.SelectQuery_;



            //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

            dbCommand.CommandText = selectQuery;

            //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
            DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

            dataAdapter.Fill(tb);

            DataRow[] dr = tb.Select();
            int rowCount = dr.Length;

            foreach (DataRow item in dr)
            {
                CALCULATION_QUEUE_INFO_Table_DAO dao = new CALCULATION_QUEUE_INFO_Table_DAO();

                dao.INST_CODE_ = item[0].ToString();
                dao.INST_TYPE_ = item[1].ToString();
                dao.INST_NAME_ = item[2].ToString();
                dao.PARA_DATE_ = item[3].ToString();
                dao.CALCULATION_STATE_ = item[4].ToString();

                this.DAOList_.Add(dao);
            }



        }
예제 #3
0
        public void select(DbConnection conn)
        {
            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }

            DataTable tb = new DataTable();

            this.DAOList_ = new List <CALCULATION_QUEUE_INFO_Table_DAO>();

            DbCommand dbCommand = conn.CreateCommand();

            string selectQuery = CALCULATION_QUEUE_INFO_Table_DAOManager.SelectQuery_;



            //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

            dbCommand.CommandText = selectQuery;

            //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
            DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

            dataAdapter.Fill(tb);

            DataRow[] dr       = tb.Select();
            int       rowCount = dr.Length;

            foreach (DataRow item in dr)
            {
                CALCULATION_QUEUE_INFO_Table_DAO dao = new CALCULATION_QUEUE_INFO_Table_DAO();

                dao.INST_CODE_         = item[0].ToString();
                dao.INST_TYPE_         = item[1].ToString();
                dao.INST_NAME_         = item[2].ToString();
                dao.PARA_DATE_         = item[3].ToString();
                dao.CALCULATION_STATE_ = item[4].ToString();

                this.DAOList_.Add(dao);
            }
        }
        //public void buildInstrumentInfo()
        //{
        //    //this.xmlDoc_.LoadXml(this.InstrumentXml_);

        //    this.InstrumentType_ = "testType";
        //    this.InstrumentCode_ = "testCode";
        //    this.ReferenceDate_ = "testRefDate";
        //}

        public override void DoJob()
        {
            //this.buildInstrumentInfo();

            // db queue insert

            CALCULATION_QUEUE_INFO_Table_DAO dao = new CALCULATION_QUEUE_INFO_Table_DAO();

            GridCalculationViewModel gcvm = this.MessageViewModel_.MessageBodyViewModel_ as GridCalculationViewModel;

            dao.INST_CODE_ = gcvm.Inst_code_;
            dao.INST_NAME_ = gcvm.Inst_name_;
            dao.INST_TYPE_ = gcvm.Inst_type_;
            dao.PARA_DATE_ = gcvm.Para_refDate_;

            dao.CALCULATION_STATE_ = "regist";

            string connectionStr = DataBaseConnectManager.ConnectionString_;

            if (dao.CALCULATION_STATE_ == "regist")
            {
                dao.insert(DataBaseConnectManager.ConnectionFactory("sqlCe", connectionStr));
                File.WriteAllText(gcvm.Inst_code_ + ".xml", gcvm.InnerXml_);
            }
            else if (dao.CALCULATION_STATE_ == "deRegist")
            {
                dao.delete(DataBaseConnectManager.ConnectionFactory("sqlCe", connectionStr));
            }
            else
            {
            }


            //string fileName = this.InstrumentCode_;

            //File.WriteAllText(fileName, this.InstrumentXml_);

            //Console.WriteLine("File Saved. , name : {0} : ", fileName);

            //AsynchronousSocketListener.InstrumentQueue_.Enqueue(this);
        }