コード例 #1
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox1.Checked == true)
     {
         dateTimePicker1.Enabled = false;
         addGridView(query.querySelectOperations());
     }
     else
     {
         dateTimePicker1.Enabled = true;
         addGridView(query.querySelectOperations(dateTimePicker1.Value.Date));
     }
 }
コード例 #2
0
        public OperationsListForm()
        {
            InitializeComponent();

            query = new QueryContractTechOperations();

            this.Text = Properties.Resources.Operations;

            labelSearch.Text   = Properties.Resources.Search;
            labelDate.Text     = Properties.Resources.Date;
            buttonCreate.Text  = Properties.Resources.Create;
            buttonEdit.Text    = Properties.Resources.Edit;
            checkBox1.Text     = Properties.Resources.All;
            button1.Text       = Properties.Resources.Delete;
            buttonRefresh.Text = Properties.Resources.Refresh;

            searchTechCardIdBox.Text = Properties.Resources.ID;
            buttonSearch.Text        = Properties.Resources.Search;

            dataGridView1.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
            dataGridView1.ReadOnly            = true;
            dataGridView1.AllowUserToAddRows  = false;
            dataGridView1.RowHeadersVisible   = false;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView1.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
            dataGridView1.ScrollBars          = ScrollBars.Both;

            DataGridViewTextBoxColumn col0 = new DataGridViewTextBoxColumn();

            col0.HeaderText = Properties.Resources.ID;

            DataGridViewTextBoxColumn col1 = new DataGridViewTextBoxColumn();

            col1.HeaderText = Properties.Resources.Date;

            DataGridViewTextBoxColumn col2 = new DataGridViewTextBoxColumn();

            col2.HeaderText = Properties.Resources.Card;

            DataGridViewTextBoxColumn col3 = new DataGridViewTextBoxColumn();

            col3.HeaderText = Properties.Resources.Count;


            dataGridView1.Columns.Add(col0);
            dataGridView1.Columns.Add(col1);
            dataGridView1.Columns.Add(col2);
            dataGridView1.Columns.Add(col3);

            addGridView(query.querySelectOperations());
        }