Exemple #1
0
        public A()
        {
            oracon = new OracleConnection("server = 127.0.0.1/orcx; user id = qzdata; password = xie51");
            oracon2 = new OracleConnection("server = 10.5.67.11/pdbqz; user id = qzdata; password = qz9401tw");
            wordapp = new word.Application();
            worddoc = new word.Document();
            worddoc = wordapp.Documents.Add();

            worddoc.SpellingChecked = false;
            worddoc.ShowSpellingErrors = false;

     //       wordapp.Visible = true;
            ta.wordapp = wordapp;
            ta.worddoc = worddoc;
            if (IS_YEAR)
            {
                datestr = dsf.GetDateStr(the_year_begin_int, the_month_begin_int, the_year_end_int, the_month_end_int);
            }
            else
            {
                datestr = dsf.GetDateStr(the_date);
            }
            
       //     datestr_abid = "(" + datestr + "and a.ab_id >=1 and a.ab_id <= 7)";
            datestr_abid = "(" + datestr + "and" + abidstr + ")";
            oracon2.Open();
            orahlper = new OraHelper(oracon2);
            orahlper.feedback = true;

            the_month_begin = new DateTime(the_date.Year, the_date.Month, 1, 0, 0, 0);
            the_month_end = the_month_begin.AddMonths(1).AddSeconds(-1);

        }
Exemple #2
0
        public GSetRule(OraHelper orah, DataTable dt_science, DataTable dt_item, DataTable dt_units, DataTable dt_abtype, DataTable dt_abtype2, DataTable dt_stations)
        {
            InitializeComponent();
            this.orah = orah;

            dataGridView_Science.DataSource = dt_science;
            dataGridView_Science.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            this.dt_units = dt_units.Copy();
            this.dt_units.Columns.Remove("NUM");
            this.dt_units.Columns.Add("NUM", typeof(int));
            dataGridView_Unit.DataSource = this.dt_units;
            dataGridView_Unit.Columns["UNIT_CODE"].Visible = false;

            dataGridView_Unit.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dv_item = new DataView(dt_item);
            dataGridView_Item.DataSource = dv_item;
            dataGridView_Item.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView_Item.Columns["SCIENCE"].Visible = false;

            dataGridView_AbType.DataSource = dt_abtype;
            dataGridView_AbType.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView_AbType.Columns["AB_TYPE"].Visible = false;
            dataGridView_AbType.Columns["AB_ID"].Visible = false;

            this.dt_abtype2 = dt_abtype2.Copy();
            this.dt_abtype2.Columns.Add("NUM", typeof(int));
            dv_abtype2 = new DataView(this.dt_abtype2);

            dataGridView_AbType2.DataSource = dv_abtype2;
            dataGridView_AbType2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView_AbType2.Columns["AB_ID"].Visible = false;
            dataGridView_AbType2.Columns["TYPE2_ID"].Visible = false;
            dataGridView_AbType2.Columns["SCIENCE"].Visible = false;

            this.dt_stations = dt_stations.Copy();
            this.dt_stations.Columns.Add("NUM", typeof(int));
            dv_stations = new DataView(this.dt_stations);
            dataGridView_Station.DataSource = dv_stations;
            dataGridView_Station.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView_Station.Columns["UNITCODE"].Visible = false;
            dataGridView_Station.Columns["STATIONID"].Visible = false;

            dateTimePicker_Begin.Value = DateTime.Parse("2015/1/1 00:00:00");
            dateTimePicker_Begin.Format = DateTimePickerFormat.Custom;
            dateTimePicker_Begin.CustomFormat = "yyyy/MM/dd HH:mm:ss";
            dateTimePicker_End.Value = DateTime.Parse("2015/12/31 23:59:59");
            dateTimePicker_End.Format = DateTimePickerFormat.Custom;
            dateTimePicker_End.CustomFormat = "yyyy/MM/dd HH:mm:ss";
              //      richTextBox_Sql.ReadOnly = true;

            button_CalType2Num.BackColor = button_CalUnitNum.BackColor = button_CalStationNum.BackColor = Color.PaleVioletRed;
            radioButton_ShowMain.Checked = true;
        }