예제 #1
0
        void Initialze()
        {
            WipQuerier = new ReqRpt002WipQuerier(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            TdMoveQuerier = new ReqRpt002MoveQuerier(DtNow.ToString("yyyy-MM-dd"));
            foreach (var dept in ModuleDepartments)
            {
                var entity = new ReqRpt002DepartmentTableRowEntity();
                SetRowEntity(entity, dept);
                DeptTableModuleRowEntities.Add(entity);
            }
            foreach (var dept in TestDepartment)
            {
                var entity = new ReqRpt002DepartmentTableRowEntity();
                SetRowEntity(entity, dept);
                DeptTableTestRowEntities.Add(entity);
            }
            foreach (var dept in BankDepartment)
            {
                var entity = new ReqRpt002DepartmentTableRowEntity();
                SetRowEntity(entity, dept);
                DeptTableBankRowEntities.Add(entity);
            }
            //ModuleTotal
            ModuleTotal.Department = "Module Total";
            SetTotalEntity(ModuleTotal, DeptTableModuleRowEntities);
            //TestTotal
            TestTotal.Department = "Test Total";
            SetTotalEntity(TestTotal, DeptTableTestRowEntities);
            //BankTotal
            DeptTableBankRowEntities[0].Department = "Normal Bank";
            BankTotal.Department = "Bank Total";
            SetTotalEntity(BankTotal, DeptTableBankRowEntities);
            //FabTotal
            FabTotal.Department = "Fab Total";
            SetTotalEntity(FabTotal, DeptTableModuleRowEntities.Union(DeptTableTestRowEntities).Union(DeptTableBankRowEntities).ToList());
            GetCtData();
            SetDevValue();
        }
예제 #2
0
        /// <summary>
        /// 更新市场状态
        /// </summary>
        public void UpdateMarketStatus()
        {
            /*连接数据库,更新dicMarketStatus
             */

            string connString = string.Format(@"User ID={0};Password={1};Data Source=(DESCRIPTION = (ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = {2})(PORT = {3}))) (CONNECT_DATA = (SERVICE_NAME = {4})))",
                                              acc,
                                              pwd,
                                              ip,
                                              port,
                                              service);

            using (OracleCommand cmd = new OracleCommand())
            {
                using (OracleConnection conn = new OracleConnection(connString))
                {
                    conn.Open();
                    cmd.Connection = conn;

                    List <string> tmpKeys = new List <string>(dicMarketStatus.Keys);
                    for (int i = 0; i < tmpKeys.Count; i++)
                    {
                        string tmpKey   = tmpKeys[i];
                        bool   tmpValue = true;
                        //bool tmpValue = dicMarketStatus[tmpKey];
                        cmd.CommandText = string.Format(@"select {0} from {1} where {2}='{3}' and {4}='{5}'", colstatus, table, coldate, DtNow.ToString("yyyyMMdd"), colmarket, tmpKey);
                        object result = cmd.ExecuteScalar();
                        if (result == null)
                        {
                            tmpValue = false;
                        }
                        else
                        {
                            if (result.ToString() == "1")
                            {
                                tmpValue = true;
                            }
                            else
                            {
                                tmpValue = false;
                            }
                        }
                        dicMarketStatus[tmpKey] = tmpValue;
                    }
                }
            }

            // 更新list
            foreach (HqFile tmpHqFile in _listHqFile)
            {
                if (dicMarketStatus.ContainsKey(tmpHqFile.Market))
                {
                    tmpHqFile.IsTradingDay = dicMarketStatus[tmpHqFile.Market];
                }
                else // 找不到的市场默认是交易日
                {
                    tmpHqFile.IsTradingDay = true;
                }
            }
        }