예제 #1
0
파일: Form1.cs 프로젝트: huaminglee/DeeHome
    public void Form1_Load(object sender, EventArgs e)
    {
        DataGridViewCheckBoxColumn column0 =
            new DataGridViewCheckBoxColumn();
        DataGridViewDisableButtonColumn column1 =
            new DataGridViewDisableButtonColumn();
        column0.Name = "CheckBoxes";
        column1.Name = "Buttons";
        dataGridView1.Columns.Add(column0);
        dataGridView1.Columns.Add(column1);
        dataGridView1.RowCount = 8;
        dataGridView1.AutoSize = true;
        dataGridView1.AllowUserToAddRows = false;
        dataGridView1.ColumnHeadersDefaultCellStyle.Alignment =
            DataGridViewContentAlignment.MiddleCenter;

        // Set the text for each button.
        for (int i = 0; i < dataGridView1.RowCount; i++)
        {
            dataGridView1.Rows[i].Cells["Buttons"].Value =
                "Button " + i.ToString();
        }

        dataGridView1.CellValueChanged +=
            new DataGridViewCellEventHandler(dataGridView1_CellValueChanged);
        dataGridView1.CurrentCellDirtyStateChanged +=
            new EventHandler(dataGridView1_CurrentCellDirtyStateChanged);
        dataGridView1.CellClick +=
            new DataGridViewCellEventHandler(dataGridView1_CellClick);

        this.Controls.Add(dataGridView1);
    }
예제 #2
0
        private void InitializeComponent()
        {
            this.components = (IContainer) new Container();
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(CQGInstruments));

            this.lwInstruments  = new DataGridView();
            this.InstrumentId   = new DataGridViewTextBoxColumn();
            this.InstrumentName = new DataGridViewTextBoxColumn();
            this.Active         = new DataGridViewCheckBoxColumn();
            this.scrollTimer    = new Timer(this.components);
            this.panel2         = new Panel();
            this.scrollPanel    = new Panel();
            this.bDown          = new Button();
            this.btScroll       = new Button();
            this.bUp            = new Button();
            this.panel4         = new Panel();
            this.panel6         = new Panel();
            this.panel7         = new Panel();
            this.panel5         = new Panel();
            this.label4         = new Label();
            this.bSubmit        = new Button();
            this.tbInstrumentId = new TextBox();
            this.button3        = new Button();
            this.lInstumentId   = new Label();
            this.button1        = new Button();
            this.button4        = new Button();
            this.button2        = new Button();
            this.label7         = new Label();
            this.linkLabel1     = new LinkLabel();
            this.label6         = new Label();
            this.button8        = new Button();
            this.label3         = new Label();
            this.pictureBox2    = new PictureBox();
            this.button5        = new Button();
            this.button6        = new Button();
            ((ISupportInitialize)this.lwInstruments).BeginInit();
            this.panel2.SuspendLayout();
            this.scrollPanel.SuspendLayout();
            ((ISupportInitialize)this.pictureBox2).BeginInit();
            this.SuspendLayout();
            this.lwInstruments.AllowUserToAddRows          = false;
            this.lwInstruments.BackgroundColor             = Color.FromArgb(0, 22, 54);
            this.lwInstruments.BorderStyle                 = BorderStyle.None;
            this.lwInstruments.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.lwInstruments.ColumnHeadersVisible        = false;
            this.lwInstruments.Columns.AddRange((DataGridViewColumn)this.InstrumentId, (DataGridViewColumn)this.InstrumentName, (DataGridViewColumn)this.Active);
            this.lwInstruments.GridColor         = Color.FromArgb(0, 43, 73);
            this.lwInstruments.Location          = new Point(6, 154);
            this.lwInstruments.Name              = "lwInstruments";
            this.lwInstruments.RowHeadersVisible = false;
            this.lwInstruments.RowTemplate.DefaultCellStyle.BackColor          = Color.FromArgb(0, 22, 54);
            this.lwInstruments.RowTemplate.DefaultCellStyle.ForeColor          = Color.White;
            this.lwInstruments.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.FromArgb(73, 138, 243);
            this.lwInstruments.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.White;
            this.lwInstruments.ScrollBars  = ScrollBars.None;
            this.lwInstruments.Size        = new Size(293, 372);
            this.lwInstruments.TabIndex    = 72;
            this.InstrumentId.HeaderText   = "Id";
            this.InstrumentId.Name         = "InstrumentId";
            this.InstrumentId.Visible      = false;
            this.InstrumentName.HeaderText = "Instrument Name";
            this.InstrumentName.Name       = "InstrumentName";
            this.InstrumentName.ReadOnly   = true;
            this.InstrumentName.Width      = 200;
            this.Active.HeaderText         = "Active";
            this.Active.Name                  = "Active";
            this.Active.Width                 = 80;
            this.scrollTimer.Tick            += new EventHandler(this.scrollTimer_Tick);
            this.panel2.BackColor             = Color.Black;
            this.panel2.BackgroundImage       = (Image)Resources.lm16553;
            this.panel2.BackgroundImageLayout = ImageLayout.Center;
            this.panel2.Controls.Add((Control)this.scrollPanel);
            this.panel2.Controls.Add((Control)this.panel4);
            this.panel2.Controls.Add((Control)this.panel6);
            this.panel2.Controls.Add((Control)this.panel7);
            this.panel2.Controls.Add((Control)this.panel5);
            this.panel2.Controls.Add((Control)this.label4);
            this.panel2.Controls.Add((Control)this.bSubmit);
            this.panel2.Controls.Add((Control)this.tbInstrumentId);
            this.panel2.Controls.Add((Control)this.button3);
            this.panel2.Controls.Add((Control)this.lInstumentId);
            this.panel2.Controls.Add((Control)this.button1);
            this.panel2.Controls.Add((Control)this.button4);
            this.panel2.Controls.Add((Control)this.button2);
            this.panel2.Controls.Add((Control)this.label7);
            this.panel2.Controls.Add((Control)this.linkLabel1);
            this.panel2.Controls.Add((Control)this.label6);
            this.panel2.Controls.Add((Control)this.button8);
            this.panel2.Controls.Add((Control)this.label3);
            this.panel2.Controls.Add((Control)this.pictureBox2);
            this.panel2.Controls.Add((Control)this.button5);
            this.panel2.Controls.Add((Control)this.button6);
            this.panel2.Location       = new Point(0, 0);
            this.panel2.Name           = "panel2";
            this.panel2.Size           = new Size(330, 678);
            this.panel2.TabIndex       = 66;
            this.panel2.MouseDown     += new MouseEventHandler(this.panel2_MouseDown);
            this.panel2.MouseMove     += new MouseEventHandler(this.panel2_MouseMove);
            this.scrollPanel.BackColor = Color.FromArgb(0, 22, 54);
            this.scrollPanel.Controls.Add((Control)this.bDown);
            this.scrollPanel.Controls.Add((Control)this.btScroll);
            this.scrollPanel.Controls.Add((Control)this.bUp);
            this.scrollPanel.Location            = new Point(302, 137);
            this.scrollPanel.Name                = "scrollPanel";
            this.scrollPanel.Size                = new Size(25, 397);
            this.scrollPanel.TabIndex            = 93;
            this.scrollPanel.MouseDown          += new MouseEventHandler(this.scrollPanel_MouseDown);
            this.bDown.BackColor                 = Color.FromArgb(0, 77, 111);
            this.bDown.BackgroundImage           = (Image)Resources.ScrollDn;
            this.bDown.Cursor                    = Cursors.Hand;
            this.bDown.FlatAppearance.BorderSize = 0;
            this.bDown.FlatStyle                 = FlatStyle.Flat;
            this.bDown.ForeColor                 = Color.White;
            this.bDown.Location                  = new Point(3, 373);
            this.bDown.Name     = "bDown";
            this.bDown.Size     = new Size(20, 21);
            this.bDown.TabIndex = 4;
            this.bDown.UseVisualStyleBackColor = false;
            this.bDown.Click                       += new EventHandler(this.bDown_Click);
            this.bDown.MouseDown                   += new MouseEventHandler(this.bDown_MouseDown);
            this.bDown.MouseLeave                  += new EventHandler(this.bDown_MouseLeave);
            this.bDown.MouseMove                   += new MouseEventHandler(this.bDown_MouseMove);
            this.bDown.MouseUp                     += new MouseEventHandler(this.bDown_MouseUp);
            this.btScroll.BackColor                 = Color.FromArgb(0, 77, 111);
            this.btScroll.BackgroundImage           = (Image)Resources.Scroll;
            this.btScroll.Cursor                    = Cursors.Hand;
            this.btScroll.FlatAppearance.BorderSize = 0;
            this.btScroll.FlatStyle                 = FlatStyle.Flat;
            this.btScroll.Location                  = new Point(3, 25);
            this.btScroll.Name                      = "btScroll";
            this.btScroll.Size                      = new Size(20, 42);
            this.btScroll.TabIndex                  = 3;
            this.btScroll.UseVisualStyleBackColor   = false;
            this.btScroll.MouseDown                += new MouseEventHandler(this.btScroll_MouseDown);
            this.btScroll.MouseLeave               += new EventHandler(this.btScroll_MouseLeave);
            this.btScroll.MouseMove                += new MouseEventHandler(this.btScroll_MouseMove);
            this.btScroll.MouseUp                  += new MouseEventHandler(this.btScroll_MouseUp);
            this.bUp.BackColor                      = Color.FromArgb(0, 77, 111);
            this.bUp.BackgroundImage                = (Image)Resources.ScrollUp;
            this.bUp.Cursor = Cursors.Hand;
            this.bUp.FlatAppearance.BorderSize = 0;
            this.bUp.FlatStyle = FlatStyle.Flat;
            this.bUp.ForeColor = Color.White;
            this.bUp.Location  = new Point(3, 2);
            this.bUp.Name      = "bUp";
            this.bUp.Size      = new Size(20, 21);
            this.bUp.TabIndex  = 1;
            this.bUp.UseVisualStyleBackColor = false;
            this.bUp.Click                                += new EventHandler(this.bUp_Click);
            this.bUp.MouseDown                            += new MouseEventHandler(this.bUp_MouseDown);
            this.bUp.MouseLeave                           += new EventHandler(this.bUp_MouseLeave);
            this.bUp.MouseMove                            += new MouseEventHandler(this.bUp_MouseMove);
            this.bUp.MouseUp                              += new MouseEventHandler(this.bUp_MouseUp);
            this.panel4.BackColor                          = Color.Gold;
            this.panel4.BackgroundImageLayout              = ImageLayout.Stretch;
            this.panel4.Location                           = new Point(329, -8);
            this.panel4.Name                               = "panel4";
            this.panel4.Size                               = new Size(31, 692);
            this.panel4.TabIndex                           = 90;
            this.panel6.BackColor                          = Color.Gold;
            this.panel6.BackgroundImageLayout              = ImageLayout.Stretch;
            this.panel6.Location                           = new Point(-6, 677);
            this.panel6.Name                               = "panel6";
            this.panel6.Size                               = new Size(362, 10);
            this.panel6.TabIndex                           = 88;
            this.panel7.BackColor                          = Color.Gold;
            this.panel7.BackgroundImageLayout              = ImageLayout.Stretch;
            this.panel7.Location                           = new Point(-10, -9);
            this.panel7.Name                               = "panel7";
            this.panel7.Size                               = new Size(362, 10);
            this.panel7.TabIndex                           = 89;
            this.panel5.BackColor                          = Color.Gold;
            this.panel5.BackgroundImageLayout              = ImageLayout.Stretch;
            this.panel5.Location                           = new Point(-30, -5);
            this.panel5.Name                               = "panel5";
            this.panel5.Size                               = new Size(31, 692);
            this.panel5.TabIndex                           = 91;
            this.label4.AutoSize                           = true;
            this.label4.BackColor                          = Color.Transparent;
            this.label4.Font                               = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte)204);
            this.label4.ForeColor                          = Color.Gold;
            this.label4.Location                           = new Point(11, 632);
            this.label4.Name                               = "label4";
            this.label4.Size                               = new Size(239, 39);
            this.label4.TabIndex                           = 84;
            this.label4.Text                               = "For add new instrument in list, enter Instrument ID\r\nNext Click \"Send\" button. \r\nFor Example: Instrument ID: X.US.DREURUSD";
            this.bSubmit.BackColor                         = Color.Transparent;
            this.bSubmit.BackgroundImage                   = (Image)componentResourceManager.GetObject("bSubmit.BackgroundImage");
            this.bSubmit.BackgroundImageLayout             = ImageLayout.Stretch;
            this.bSubmit.Cursor                            = Cursors.Hand;
            this.bSubmit.FlatAppearance.BorderSize         = 0;
            this.bSubmit.FlatAppearance.CheckedBackColor   = Color.Transparent;
            this.bSubmit.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.bSubmit.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.bSubmit.FlatStyle                         = FlatStyle.Flat;
            this.bSubmit.Font                              = new Font("Arial", 12f);
            this.bSubmit.ForeColor                         = Color.White;
            this.bSubmit.Location                          = new Point(222, 598);
            this.bSubmit.Name                              = "bSubmit";
            this.bSubmit.Size                              = new Size(101, 28);
            this.bSubmit.TabIndex                          = 64;
            this.bSubmit.Text                              = "Send";
            this.bSubmit.UseVisualStyleBackColor           = false;
            this.bSubmit.Click                            += new EventHandler(this.bSubmit_Click);
            this.bSubmit.MouseLeave                       += new EventHandler(this.bSubmit_MouseLeave);
            this.bSubmit.MouseMove                        += new MouseEventHandler(this.bSubmit_MouseMove);
            this.tbInstrumentId.BackColor                  = Color.FromArgb(0, 22, 54);
            this.tbInstrumentId.BorderStyle                = BorderStyle.None;
            this.tbInstrumentId.ForeColor                  = Color.White;
            this.tbInstrumentId.Location                   = new Point(98, 606);
            this.tbInstrumentId.Name                       = "tbInstrumentId";
            this.tbInstrumentId.Size                       = new Size(115, 13);
            this.tbInstrumentId.TabIndex                   = 63;
            this.tbInstrumentId.Text                       = "X.US.DREURUSD";
            this.button3.BackColor                         = Color.Transparent;
            this.button3.BackgroundImage                   = (Image)componentResourceManager.GetObject("button3.BackgroundImage");
            this.button3.BackgroundImageLayout             = ImageLayout.Stretch;
            this.button3.Cursor                            = Cursors.Hand;
            this.button3.FlatAppearance.BorderSize         = 0;
            this.button3.FlatAppearance.CheckedBackColor   = Color.Transparent;
            this.button3.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.button3.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.button3.FlatStyle                         = FlatStyle.Flat;
            this.button3.Font                              = new Font("Arial", 12f, FontStyle.Regular, GraphicsUnit.Point, (byte)204);
            this.button3.ForeColor                         = Color.White;
            this.button3.Location                          = new Point(8, 552);
            this.button3.Name                              = "button3";
            this.button3.Size                              = new Size(101, 28);
            this.button3.TabIndex                          = 77;
            this.button3.Text                              = "Select All";
            this.button3.UseVisualStyleBackColor           = false;
            this.button3.Click                            += new EventHandler(this.button3_Click);
            this.button3.MouseLeave                       += new EventHandler(this.button3_MouseLeave);
            this.button3.MouseMove                        += new MouseEventHandler(this.button3_MouseMove);
            this.lInstumentId.AutoSize                     = true;
            this.lInstumentId.BackColor                    = Color.Transparent;
            this.lInstumentId.Font                         = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, (byte)204);
            this.lInstumentId.ForeColor                    = Color.White;
            this.lInstumentId.Location                     = new Point(11, 603);
            this.lInstumentId.Name                         = "lInstumentId";
            this.lInstumentId.Size                         = new Size(81, 16);
            this.lInstumentId.TabIndex                     = 62;
            this.lInstumentId.Text                         = "Instument ID";
            this.button1.BackColor                         = Color.Transparent;
            this.button1.BackgroundImage                   = (Image)Resources.sv1;
            this.button1.BackgroundImageLayout             = ImageLayout.Center;
            this.button1.Cursor                            = Cursors.Hand;
            this.button1.FlatAppearance.BorderSize         = 0;
            this.button1.FlatAppearance.CheckedBackColor   = Color.Transparent;
            this.button1.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.button1.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.button1.FlatStyle                         = FlatStyle.Flat;
            this.button1.Location                          = new Point(259, 2);
            this.button1.Name                              = "button1";
            this.button1.Size                              = new Size(35, 35);
            this.button1.TabIndex                          = 16;
            this.button1.UseVisualStyleBackColor           = false;
            this.button1.Click                            += new EventHandler(this.button1_Click);
            this.button1.MouseLeave                       += new EventHandler(this.button1_MouseLeave);
            this.button1.MouseMove                        += new MouseEventHandler(this.button1_MouseMove);
            this.button4.BackColor                         = Color.Transparent;
            this.button4.BackgroundImage                   = (Image)componentResourceManager.GetObject("button4.BackgroundImage");
            this.button4.BackgroundImageLayout             = ImageLayout.Stretch;
            this.button4.Cursor                            = Cursors.Hand;
            this.button4.FlatAppearance.BorderSize         = 0;
            this.button4.FlatAppearance.CheckedBackColor   = Color.Transparent;
            this.button4.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.button4.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.button4.FlatStyle                         = FlatStyle.Flat;
            this.button4.Font                              = new Font("Arial", 12f, FontStyle.Regular, GraphicsUnit.Point, (byte)204);
            this.button4.ForeColor                         = Color.White;
            this.button4.Location                          = new Point(115, 552);
            this.button4.Name                              = "button4";
            this.button4.Size                              = new Size(101, 28);
            this.button4.TabIndex                          = 78;
            this.button4.Text                              = "Clear";
            this.button4.UseVisualStyleBackColor           = false;
            this.button4.Click                            += new EventHandler(this.button4_Click);
            this.button4.MouseLeave                       += new EventHandler(this.button4_MouseLeave);
            this.button4.MouseMove                        += new MouseEventHandler(this.button4_MouseMove);
            this.button2.BackColor                         = Color.Transparent;
            this.button2.BackgroundImage                   = (Image)Resources.zak1;
            this.button2.BackgroundImageLayout             = ImageLayout.Center;
            this.button2.Cursor                            = Cursors.Hand;
            this.button2.FlatAppearance.BorderSize         = 0;
            this.button2.FlatAppearance.CheckedBackColor   = Color.Transparent;
            this.button2.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.button2.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.button2.FlatStyle                         = FlatStyle.Flat;
            this.button2.Location                          = new Point(295, 2);
            this.button2.Name                              = "button2";
            this.button2.Size                              = new Size(35, 35);
            this.button2.TabIndex                          = 17;
            this.button2.UseVisualStyleBackColor           = false;
            this.button2.Click                            += new EventHandler(this.button2_Click);
            this.button2.MouseLeave                       += new EventHandler(this.button2_MouseLeave);
            this.button2.MouseMove                        += new MouseEventHandler(this.button2_MouseMove);
            this.label7.AutoSize                           = true;
            this.label7.Font                               = new Font("Arial", 9.75f);
            this.label7.ForeColor                          = Color.White;
            this.label7.Location                           = new Point(282, 13);
            this.label7.Name                               = "label7";
            this.label7.Size                               = new Size(0, 16);
            this.label7.TabIndex                           = 15;
            this.linkLabel1.ActiveLinkColor                = Color.FromArgb(73, 138, 243);
            this.linkLabel1.AutoSize                       = true;
            this.linkLabel1.Font                           = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte)204);
            this.linkLabel1.LinkColor                      = Color.White;
            this.linkLabel1.Location                       = new Point(282, 14);
            this.linkLabel1.Name                           = "linkLabel1";
            this.linkLabel1.Size                           = new Size(0, 15);
            this.linkLabel1.TabIndex                       = 14;
            this.label6.AutoSize                           = true;
            this.label6.Font                               = new Font("Arial", 9.75f);
            this.label6.ForeColor                          = Color.White;
            this.label6.Location                           = new Point(277, 13);
            this.label6.Name                               = "label6";
            this.label6.Size                               = new Size(0, 16);
            this.label6.TabIndex                           = 13;
            this.button8.BackColor                         = Color.Transparent;
            this.button8.BackgroundImage                   = (Image)componentResourceManager.GetObject("button8.BackgroundImage");
            this.button8.BackgroundImageLayout             = ImageLayout.Stretch;
            this.button8.Cursor                            = Cursors.Hand;
            this.button8.FlatAppearance.BorderSize         = 0;
            this.button8.FlatAppearance.CheckedBackColor   = Color.Transparent;
            this.button8.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.button8.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.button8.FlatStyle                         = FlatStyle.Flat;
            this.button8.Font                              = new Font("Arial", 12f, FontStyle.Regular, GraphicsUnit.Point, (byte)204);
            this.button8.ForeColor                         = Color.White;
            this.button8.Location                          = new Point(222, 552);
            this.button8.Name                              = "button8";
            this.button8.Size                              = new Size(101, 28);
            this.button8.TabIndex                          = 61;
            this.button8.Text                              = "Save";
            this.button8.UseVisualStyleBackColor           = false;
            this.button8.Click                            += new EventHandler(this.button8_Click);
            this.button8.MouseLeave                       += new EventHandler(this.button8_MouseLeave);
            this.button8.MouseMove                        += new MouseEventHandler(this.button8_MouseMove);
            this.label3.AutoSize                           = true;
            this.label3.BackColor                          = Color.Transparent;
            this.label3.Font                               = new Font("Arial", 9.75f);
            this.label3.ForeColor                          = Color.FromArgb(73, 138, 243);
            this.label3.Location                           = new Point(37, 12);
            this.label3.Name                               = "label3";
            this.label3.Size                               = new Size(109, 16);
            this.label3.TabIndex                           = 12;
            this.label3.Text                               = "CQG Instruments";
            this.pictureBox2.BackColor                     = Color.Transparent;
            this.pictureBox2.BackgroundImage               = (Image)Resources.User_blue3;
            this.pictureBox2.BackgroundImageLayout         = ImageLayout.Center;
            this.pictureBox2.Location                      = new Point(2, 2);
            this.pictureBox2.Name                          = "pictureBox2";
            this.pictureBox2.Size                          = new Size(35, 35);
            this.pictureBox2.TabIndex                      = 11;
            this.pictureBox2.TabStop                       = false;
            this.button5.FlatAppearance.BorderSize         = 0;
            this.button5.FlatStyle                         = FlatStyle.Flat;
            this.button5.Location                          = new Point(896, 7);
            this.button5.Name                              = "button5";
            this.button5.Size                              = new Size(26, 26);
            this.button5.TabIndex                          = 9;
            this.button5.UseVisualStyleBackColor           = true;
            this.button6.FlatAppearance.BorderSize         = 0;
            this.button6.FlatStyle                         = FlatStyle.Flat;
            this.button6.Location                          = new Point(923, 7);
            this.button6.Name                              = "button6";
            this.button6.Size                              = new Size(26, 26);
            this.button6.TabIndex                          = 10;
            this.button6.UseVisualStyleBackColor           = true;
            this.AutoScaleDimensions                       = new SizeF(6f, 13f);
            this.AutoScaleMode                             = AutoScaleMode.Font;
            this.BackgroundImageLayout                     = ImageLayout.Center;
            this.ClientSize                                = new Size(330, 678);
            this.Controls.Add((Control)this.lwInstruments);
            this.Controls.Add((Control)this.panel2);
            this.FormBorderStyle = FormBorderStyle.None;
            this.Icon            = (Icon)componentResourceManager.GetObject("$this.Icon");
            this.Location        = new Point(620, 100);
            this.Name            = nameof(CQGInstruments);
            this.Text            = "CQG Instruments";
            ((ISupportInitialize)this.lwInstruments).EndInit();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.scrollPanel.ResumeLayout(false);
            ((ISupportInitialize)this.pictureBox2).EndInit();
            this.ResumeLayout(false);
        }
예제 #3
0
        private void InitializeComponent()
        {
            DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SoftLicTypesViewport));
            dataGridView  = new DataGridView();
            idSoftLicType = new DataGridViewTextBoxColumn();
            softLicType   = new DataGridViewTextBoxColumn();
            softLicKeyDuplicateAllowed = new DataGridViewCheckBoxColumn();
            ((System.ComponentModel.ISupportInitialize)(dataGridView)).BeginInit();
            SuspendLayout();
            //
            // dataGridView
            //
            dataGridView.AllowUserToAddRows            = false;
            dataGridView.AllowUserToDeleteRows         = false;
            dataGridView.AllowUserToResizeRows         = false;
            dataGridView.AutoSizeColumnsMode           = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView.BackgroundColor               = System.Drawing.Color.White;
            dataGridView.BorderStyle                   = BorderStyle.Fixed3D;
            dataGridViewCellStyle1.Alignment           = DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle1.BackColor           = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle1.Font                = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            dataGridViewCellStyle1.ForeColor           = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle1.Padding             = new Padding(0, 2, 0, 2);
            dataGridViewCellStyle1.SelectionBackColor  = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle1.SelectionForeColor  = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle1.WrapMode            = DataGridViewTriState.True;
            dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
            dataGridView.ColumnHeadersHeightSizeMode   = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            dataGridView.Columns.AddRange(new DataGridViewColumn[] {
                idSoftLicType,
                softLicType,
                softLicKeyDuplicateAllowed
            });
            dataGridView.Dock          = DockStyle.Fill;
            dataGridView.EditMode      = DataGridViewEditMode.EditOnEnter;
            dataGridView.Location      = new System.Drawing.Point(3, 3);
            dataGridView.MultiSelect   = false;
            dataGridView.Name          = "dataGridView";
            dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dataGridView.Size          = new System.Drawing.Size(693, 345);
            dataGridView.TabIndex      = 8;
            //
            // idSoftLicType
            //
            idSoftLicType.Frozen     = true;
            idSoftLicType.HeaderText = "Идентификатор органа";
            idSoftLicType.Name       = "idSoftLicType";
            idSoftLicType.ReadOnly   = true;
            idSoftLicType.Visible    = false;
            //
            // softLicType
            //
            softLicType.HeaderText   = "Наименование";
            softLicType.MinimumWidth = 100;
            softLicType.Name         = "softLicType";
            //
            // softLicKeyDuplicateAllowed
            //
            softLicKeyDuplicateAllowed.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
            softLicKeyDuplicateAllowed.FillWeight   = 1F;
            softLicKeyDuplicateAllowed.HeaderText   = "Разрешить дублирование лиц. ключей";
            softLicKeyDuplicateAllowed.MinimumWidth = 200;
            softLicKeyDuplicateAllowed.Name         = "softLicKeyDuplicateAllowed";
            softLicKeyDuplicateAllowed.Resizable    = DataGridViewTriState.True;
            softLicKeyDuplicateAllowed.SortMode     = DataGridViewColumnSortMode.Automatic;
            softLicKeyDuplicateAllowed.Width        = 200;
            //
            // SoftLicTypesViewport
            //
            BackColor  = System.Drawing.Color.White;
            ClientSize = new System.Drawing.Size(699, 351);
            Controls.Add(dataGridView);
            Font    = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            Icon    = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            Name    = "SoftLicTypesViewport";
            Padding = new Padding(3);
            Text    = "Виды лицензий на ПО";
            ((System.ComponentModel.ISupportInitialize)(dataGridView)).EndInit();
            ResumeLayout(false);
        }
예제 #4
0
        private void ServerManager_Load(object sender, EventArgs e)
        {
            DBListSet                  = new DataSet();
            mangosDBList.DropDown     += new EventHandler(DBList_DropDown);
            charactersDBList.DropDown += new EventHandler(DBList_DropDown);
            realmdDBList.DropDown     += new EventHandler(DBList_DropDown);
            HostNameTextBox.Text       = ConnInfo.HostName;
            PWDTextBox.Text            = ConnInfo.PassWord;
            UserNameTextBox.Text       = ConnInfo.UserName;
            ServerManager.HostName     = HostNameTextBox.Text;
            ServerManager.Password     = PWDTextBox.Text;
            ServerManager.UserName     = UserNameTextBox.Text;
            ServerManager.MangosDB     = mangosDBList.Text;
            ServerManager.CharactersDB = charactersDBList.Text;
            ServerManager.RealmdDB     = realmdDBList.Text;
            DataGridViewTextBoxColumn coln1 = new DataGridViewTextBoxColumn();

            coln1.Width    = 70;
            coln1.Name     = "账号ID";
            coln1.ReadOnly = true;
            DataGridViewTextBoxColumn coln2 = new DataGridViewTextBoxColumn();

            coln2.Width    = 80;
            coln2.Name     = "账号名称";
            coln2.ReadOnly = true;
            DataGridViewTextBoxColumn coln3 = new DataGridViewTextBoxColumn();

            coln3.Width    = 70;
            coln3.Name     = "角色ID";
            coln3.ReadOnly = true;
            DataGridViewTextBoxColumn coln4 = new DataGridViewTextBoxColumn();

            coln4.Width    = 80;
            coln4.Name     = "角色名称";
            coln4.ReadOnly = true;
            DataGridViewCheckBoxColumn checkboxColn1 = new DataGridViewCheckBoxColumn();

            checkboxColn1.Width = 50;
            checkboxColn1.Name  = "选择";
            Mail_ReceiverDataGridView.Columns.Add(checkboxColn1);
            Mail_ReceiverDataGridView.Columns.Add(coln1);
            Mail_ReceiverDataGridView.Columns.Add(coln2);
            Mail_ReceiverDataGridView.Columns.Add(coln3);
            Mail_ReceiverDataGridView.Columns.Add(coln4);


            DataGridViewTextBoxColumn coln5 = new DataGridViewTextBoxColumn();

            coln5.Width    = 70;
            coln5.Name     = "物品ID";
            coln5.ReadOnly = true;
            DataGridViewTextBoxColumn coln6 = new DataGridViewTextBoxColumn();

            coln6.Width    = 80;
            coln6.Name     = "物品名称";
            coln6.ReadOnly = true;
            DataGridViewTextBoxColumn coln7 = new DataGridViewTextBoxColumn();

            coln7.Width    = 60;
            coln7.Name     = "数量";
            coln7.ReadOnly = false;
            DataGridViewCheckBoxColumn checkboxColn2 = new DataGridViewCheckBoxColumn();

            checkboxColn2.Width = 50;
            checkboxColn2.Name  = "选择";
            Mail_ItemDataGridView.Columns.Add(checkboxColn2);
            Mail_ItemDataGridView.Columns.Add(coln5);
            Mail_ItemDataGridView.Columns.Add(coln6);
            Mail_ItemDataGridView.Columns.Add(coln7);
        }
예제 #5
0
        private void InitializeComponent()
        {
            DataGridViewCellStyle dataGridViewCellStyle  = new DataGridViewCellStyle();
            DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
            DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
            DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();

            this.splitContainer1            = new SplitContainer();
            this.DataGridView1              = new DataGridView();
            this.DataGridView2              = new DataGridView();
            this.DataGridViewTextBoxColumn1 = new DataGridViewCheckBoxColumn();
            this.Column5 = new DataGridViewTextBoxColumn();
            this.Column2 = new DataGridViewComboBoxColumn();
            this.Column3 = new DataGridViewComboBoxColumn();
            this.Column1 = new DataGridViewCheckBoxColumn();
            this.Column4 = new DataGridViewTextBoxColumn();
            this.Column6 = new DataGridViewButtonColumn();
            ((ISupportInitialize)this.splitContainer1).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((ISupportInitialize)this.DataGridView1).BeginInit();
            ((ISupportInitialize)this.DataGridView2).BeginInit();
            base.SuspendLayout();
            this.splitContainer1.Dock            = DockStyle.Fill;
            this.splitContainer1.FixedPanel      = FixedPanel.Panel1;
            this.splitContainer1.IsSplitterFixed = true;
            this.splitContainer1.Location        = new Point(0, 0);
            this.splitContainer1.Name            = "splitContainer1";
            this.splitContainer1.Panel1.Controls.Add(this.DataGridView1);
            this.splitContainer1.Panel2.Controls.Add(this.DataGridView2);
            this.splitContainer1.Size             = new Size(491, 285);
            this.splitContainer1.SplitterDistance = 160;
            this.splitContainer1.SplitterWidth    = 2;
            this.splitContainer1.TabIndex         = 23;
            dataGridViewCellStyle.BackColor       = Color.FromArgb(241, 244, 248);
            this.DataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
            this.DataGridView1.BackgroundColor               = Color.White;
            this.DataGridView1.BorderStyle                   = BorderStyle.Fixed3D;
            dataGridViewCellStyle2.Alignment                 = DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle2.BackColor                 = SystemColors.Control;
            dataGridViewCellStyle2.Font                      = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 134);
            dataGridViewCellStyle2.ForeColor                 = SystemColors.WindowText;
            dataGridViewCellStyle2.SelectionBackColor        = SystemColors.Highlight;
            dataGridViewCellStyle2.SelectionForeColor        = SystemColors.HighlightText;
            dataGridViewCellStyle2.WrapMode                  = DataGridViewTriState.True;
            this.DataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
            this.DataGridView1.ColumnHeadersHeight           = 32;
            this.DataGridView1.Columns.AddRange(new DataGridViewColumn[]
            {
                this.Column1,
                this.Column4,
                this.Column6
            });
            this.DataGridView1.Dock               = DockStyle.Fill;
            this.DataGridView1.GridColor          = SystemColors.ActiveBorder;
            this.DataGridView1.Location           = new Point(0, 0);
            this.DataGridView1.MultiSelect        = false;
            this.DataGridView1.Name               = "DataGridView1";
            this.DataGridView1.RowTemplate.Height = 23;
            this.DataGridView1.SelectionMode      = DataGridViewSelectionMode.CellSelect;
            this.DataGridView1.Size               = new Size(160, 285);
            this.DataGridView1.TabIndex           = 22;
            dataGridViewCellStyle3.BackColor      = Color.FromArgb(241, 244, 248);
            this.DataGridView2.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
            this.DataGridView2.BackgroundColor               = Color.White;
            this.DataGridView2.BorderStyle                   = BorderStyle.Fixed3D;
            dataGridViewCellStyle4.Alignment                 = DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle4.BackColor                 = SystemColors.Control;
            dataGridViewCellStyle4.Font                      = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 134);
            dataGridViewCellStyle4.ForeColor                 = SystemColors.WindowText;
            dataGridViewCellStyle4.SelectionBackColor        = SystemColors.Highlight;
            dataGridViewCellStyle4.SelectionForeColor        = SystemColors.HighlightText;
            dataGridViewCellStyle4.WrapMode                  = DataGridViewTriState.True;
            this.DataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
            this.DataGridView2.ColumnHeadersHeight           = 32;
            this.DataGridView2.Columns.AddRange(new DataGridViewColumn[]
            {
                this.DataGridViewTextBoxColumn1,
                this.Column5,
                this.Column2,
                this.Column3
            });
            this.DataGridView2.Dock                    = DockStyle.Fill;
            this.DataGridView2.GridColor               = SystemColors.ActiveBorder;
            this.DataGridView2.Location                = new Point(0, 0);
            this.DataGridView2.MultiSelect             = false;
            this.DataGridView2.Name                    = "DataGridView2";
            this.DataGridView2.RowTemplate.Height      = 23;
            this.DataGridView2.SelectionMode           = DataGridViewSelectionMode.CellSelect;
            this.DataGridView2.Size                    = new Size(329, 285);
            this.DataGridView2.TabIndex                = 23;
            this.DataGridViewTextBoxColumn1.HeaderText = "";
            this.DataGridViewTextBoxColumn1.Name       = "DataGridViewTextBoxColumn1";
            this.DataGridViewTextBoxColumn1.Resizable  = DataGridViewTriState.True;
            this.DataGridViewTextBoxColumn1.SortMode   = DataGridViewColumnSortMode.Automatic;
            this.DataGridViewTextBoxColumn1.Width      = 25;
            this.Column5.HeaderText                    = "测量点号";
            this.Column5.Name       = "Column5";
            this.Column5.Width      = 40;
            this.Column2.HeaderText = "正反向";
            this.Column2.Items.AddRange(new object[]
            {
                "正向",
                "反向",
                ""
            });
            this.Column2.Name       = "Column2";
            this.Column3.HeaderText = "总加运算符标志";
            this.Column3.Items.AddRange(new object[]
            {
                "加运算",
                "减运算",
                ""
            });
            this.Column3.Name        = "Column3";
            this.Column1.HeaderText  = "";
            this.Column1.Name        = "Column1";
            this.Column1.Resizable   = DataGridViewTriState.True;
            this.Column1.SortMode    = DataGridViewColumnSortMode.Automatic;
            this.Column1.Width       = 25;
            this.Column4.HeaderText  = "总加组序号";
            this.Column4.Name        = "Column4";
            this.Column4.Width       = 70;
            this.Column6.HeaderText  = "保存";
            this.Column6.Name        = "Column6";
            this.Column6.Width       = 20;
            base.AutoScaleDimensions = new SizeF(6f, 12f);

            base.ClientSize = new Size(491, 285);
            base.Controls.Add(this.splitContainer1);
            base.Name = "AFN04_14";
            this.Text = "终端总加组配置参数";
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            ((ISupportInitialize)this.splitContainer1).EndInit();
            this.splitContainer1.ResumeLayout(false);
            ((ISupportInitialize)this.DataGridView1).EndInit();
            ((ISupportInitialize)this.DataGridView2).EndInit();
            base.ResumeLayout(false);
        }
        /// <summary>
        /// To grant a system privilege,
        /// you must either have been granted the system privilege with the ADMIN OPTION
        /// or
        /// have been granted the GRANT ANY PRIVILEGE system privilege.
        /// </summary>
        private void LoadPrivilege()
        {
            //Get privilege
            Privilege privilege = new Privilege()
            {
                Name = "GRANT ANY PRIVILEGE"
            };
            List <Privilege> items;

            if (this.privilegeBLL.HasSystemPrivilege(this.currentUser.UserName, privilege))
            {
                items = this.privilegeBLL.SystemPrivileges();
            }
            else
            {
                items = this.privilegeBLL.SystemPrivileges(this.currentUser.UserName, true);
            }

            //Setup column
            DataGridViewCheckBoxColumn privilegeColumn = new DataGridViewCheckBoxColumn()
            {
                FalseValue   = 0,
                TrueValue    = 1,
                Visible      = true,
                AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
            };
            DataGridViewTextBoxColumn contentColumn = new DataGridViewTextBoxColumn()
            {
                Name         = "Privilege",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
            };
            DataGridViewCheckBoxColumn adminColumn = new DataGridViewCheckBoxColumn()
            {
                Name         = "Admin",
                FalseValue   = 0,
                TrueValue    = 1,
                Visible      = true,
                AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader
            };

            this.DgvPrivilege.Columns.Add(privilegeColumn);
            this.DgvPrivilege.Columns.Add(contentColumn);
            this.DgvPrivilege.Columns.Add(adminColumn);
            foreach (var item in items)
            {
                DataGridViewRow          row      = new DataGridViewRow();
                DataGridViewCheckBoxCell cellName = new DataGridViewCheckBoxCell
                {
                    ToolTipText = item.Name,
                    Value       = false
                };
                DataGridViewTextBoxCell cellPrivilege = new DataGridViewTextBoxCell()
                {
                    Value = item.Name,
                };
                DataGridViewCheckBoxCell cellAdmin = new DataGridViewCheckBoxCell
                {
                    Value = false
                };
                row.Cells.Add(cellName);
                row.Cells.Add(cellPrivilege);
                row.Cells.Add(cellAdmin);

                this.DgvPrivilege.Rows.Add(row);
            }
            contentColumn.ReadOnly = true;
        }
예제 #7
0
        private DataGridView GetDGV(InventoryPouch pouch)
        {
            // Add DataGrid
            DataGridView dgv = new DataGridView
            {
                Dock = DockStyle.Fill,
                Text = pouch.Type.ToString(),
                Name = DGVPrefix + pouch.Type,

                AllowUserToAddRows       = false,
                AllowUserToDeleteRows    = false,
                AllowUserToResizeRows    = false,
                AllowUserToResizeColumns = false,
                RowHeadersVisible        = false,
                //ColumnHeadersVisible = false,
                MultiSelect     = false,
                ShowEditingIcon = false,

                EditMode = DataGridViewEditMode.EditOnEnter,
                ColumnHeadersBorderStyle    = DataGridViewHeaderBorderStyle.Single,
                ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize,
                SelectionMode   = DataGridViewSelectionMode.CellSelect,
                CellBorderStyle = DataGridViewCellBorderStyle.None,
            };

            int c = 0;
            DataGridViewComboBoxColumn dgvItemVal = new DataGridViewComboBoxColumn
            {
                HeaderText   = "Item",
                DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing,
                DisplayIndex = c++,
                Width        = 135,
                FlatStyle    = FlatStyle.Flat
            };
            DataGridViewColumn dgvIndex = new DataGridViewTextBoxColumn();

            {
                dgvIndex.HeaderText   = "Count";
                dgvIndex.DisplayIndex = c++;
                dgvIndex.Width        = 45;
                dgvIndex.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                if (!Main.HaX)
                {
                    ((DataGridViewTextBoxColumn)dgvIndex).MaxInputLength = (int)(Math.Log10(Math.Max(1, pouch.MaxCount)) + 1);
                }
            }

            dgv.Columns.Add(dgvItemVal);
            dgv.Columns.Add(dgvIndex);

            if (HasFreeSpace)
            {
                DataGridViewCheckBoxColumn dgvFree = new DataGridViewCheckBoxColumn
                {
                    HeaderText   = "Free",
                    DisplayIndex = c++,
                    Width        = 40,
                    FlatStyle    = FlatStyle.Flat
                };
                dgv.Columns.Add(dgvFree);
            }
            if (HasNew)
            {
                DataGridViewCheckBoxColumn dgvNew = new DataGridViewCheckBoxColumn
                {
                    HeaderText   = "NEW",
                    DisplayIndex = c++,
                    Width        = 40,
                    FlatStyle    = FlatStyle.Flat
                };
                dgv.Columns.Add(dgvNew);
            }

            var itemcount = pouch.Items.Length;

            string[] itemarr = Main.HaX ? (string[])itemlist.Clone() : GetItems(pouch.LegalItems);

            var combo = dgv.Columns[0] as DataGridViewComboBoxColumn;

            foreach (string t in itemarr)
            {
                combo.Items.Add(t); // add only the Item Names
            }
            dgv.Rows.Add(itemcount > 0 ? itemcount : itemarr.Length);
            dgv.CancelEdit();

            return(dgv);
        }
예제 #8
0
        //查询结果
        public static void ReadGBT228(DataGridView dg, string testNo, string testSampleNo, DateTimePicker dtpFrom, DateTimePicker dtpTo, ZedGraph.ZedGraphControl zed)
        {
            BLL.TestSample bllTs    = new HR_Test.BLL.TestSample();
            string         strWhere = string.Empty;

            if (!string.IsNullOrEmpty(testNo))
            {
                strWhere += " and testNo like '%" + testNo + "%'";
            }

            if (!string.IsNullOrEmpty(testSampleNo))
            {
                strWhere += " and testSampleNo like '%" + testSampleNo + "%'";
            }

            double  maxValue = 0;
            DataSet dsmax    = bllTs.GetMaxFm("isFinish=true and isEffective=false and testDate>=#" + dtpFrom.Value.Date + "# and testDate<=#" + dtpTo.Value.Date + "#" + strWhere);

            if (dsmax != null)
            {
                if (dsmax.Tables[0].Rows.Count > 0)
                {
                    if (!string.IsNullOrEmpty(dsmax.Tables[0].Rows[0]["Fm"].ToString()))
                    {
                        maxValue = Convert.ToDouble(dsmax.Tables[0].Rows[0]["Fm"].ToString());
                    }
                }
            }

            DataSet   ds = bllTs.GetFinishList("isFinish=true and isEffective=false and testDate>=#" + dtpFrom.Value.Date + "# and testDate<=#" + dtpTo.Value.Date + "#" + strWhere, maxValue);
            DataTable dt = ds.Tables[0];

            dg.DataSource = dt;

            DataGridViewCheckBoxColumn chkcol = new DataGridViewCheckBoxColumn();

            //DataGridViewDisableCheckBoxColumn chkcol = new DataGridViewDisableCheckBoxColumn();
            chkcol.Name = "选择";

            DataGridViewTextBoxColumn c = new DataGridViewTextBoxColumn();

            c.Visible = true;
            c.Name    = "  ";
            dg.Columns.Insert(0, c);
            dg.Columns.Insert(0, chkcol);

            dg.Columns[1].Frozen = true;
            dg.Columns[2].Frozen = true;

            //dg.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
            dg.Columns[0].Width = 50;
            dg.Columns[1].Width = 50;
            dg.Columns[2].Width = 100;
            if (dg.ColumnCount > 0)
            {
                foreach (DataGridViewColumn dgvc in dg.Columns)
                {
                    dgvc.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                    dgvc.SortMode     = DataGridViewColumnSortMode.NotSortable;
                    dgvc.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                }
            }
            dg.Refresh();

            for (int i = 0; i < dg.Rows.Count; i++)
            {
                if (i > 19)
                {
                    dg.Rows[i].Cells[1].Style.BackColor          = Color.FromName(_Color_Array[i % 20]);
                    dg.Rows[i].Cells[1].Style.ForeColor          = Color.FromName(_Color_Array[i % 20]);
                    dg.Rows[i].Cells[1].Style.SelectionForeColor = Color.FromName(_Color_Array[i % 20]);
                    dg.Rows[i].Cells[1].Style.SelectionBackColor = Color.FromName(_Color_Array[i % 20]);
                    dg.Rows[i].Cells[1].Value = _Color_Array[i % 20].ToString();
                }
                else
                {
                    dg.Rows[i].Cells[1].Style.BackColor          = Color.FromName(_Color_Array[i]);
                    dg.Rows[i].Cells[1].Style.ForeColor          = Color.FromName(_Color_Array[i]);
                    dg.Rows[i].Cells[1].Style.SelectionForeColor = Color.FromName(_Color_Array[i]);
                    dg.Rows[i].Cells[1].Style.SelectionBackColor = Color.FromName(_Color_Array[i]);
                    dg.Rows[i].Cells[1].Value = _Color_Array[i].ToString();
                }
            }

            foreach (CurveItem ci in zed.GraphPane.CurveList)
            {
                ci.Clear();
                ci.Label.Text = "";
            }
            zed.AxisChange();
            zed.Refresh();
            ds.Dispose();
        }
예제 #9
0
        void _BGWAbsenceAndPeriodList_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            System.Windows.Forms.DataGridViewTextBoxColumn colName = new DataGridViewTextBoxColumn();
            colName.HeaderText   = "節次分類";
            colName.MinimumWidth = 70;
            colName.Name         = "colName";
            colName.ReadOnly     = true;
            colName.SortMode     = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            colName.Width        = 70;
            this.dataGridViewX1.Columns.Add(colName);

            foreach (string absence in absenceList)
            {
                System.Windows.Forms.DataGridViewCheckBoxColumn newCol = new DataGridViewCheckBoxColumn();
                newCol.HeaderText = absence;
                newCol.Width      = 55;
                newCol.ReadOnly   = false;
                newCol.SortMode   = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
                newCol.Tag        = absence;
                newCol.ValueType  = typeof(bool);
                this.dataGridViewX1.Columns.Add(newCol);
            }
            foreach (string type in typeList)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(dataGridViewX1, type);
                row.Tag = type;
                dataGridViewX1.Rows.Add(row);
            }

            #region 讀取列印設定 Preference
            valueOnChange = true;
            //XmlElement config = CurrentUser.Instance.Preference[_preferenceElementName];
            ConfigData cd   = School.Configuration[_preferenceElementName];
            string     strr = cd["XmlData"];
            XmlElement config;

            if (strr != "")
            {
                config = DSXmlHelper.LoadXml(strr);
                #region 已有設定檔則將設定檔內容填回畫面上
                foreach (XmlElement type in config.SelectNodes("Type"))
                {
                    string typeName = type.GetAttribute("Text");
                    foreach (DataGridViewRow row in dataGridViewX1.Rows)
                    {
                        if (typeName == ("" + row.Tag))
                        {
                            foreach (XmlElement absence in type.SelectNodes("Absence"))
                            {
                                string absenceName = absence.GetAttribute("Text");
                                foreach (DataGridViewCell cell in row.Cells)
                                {
                                    if (cell.OwningColumn is DataGridViewCheckBoxColumn && ("" + cell.OwningColumn.Tag) == absenceName)
                                    {
                                        cell.Value = true;
                                    }
                                }
                            }
                            break;
                        }
                    }
                }
                #endregion
            }
            else
            {
                #region 產生空白設定檔
                config = new XmlDocument().CreateElement(_preferenceElementName);
                //CurrentUser.Instance.Preference[_preferenceElementName] = config;
                cd.SetXml("XmlData", config);
                #endregion
            }

            cd.Save();

            valueOnChange = false;

            #endregion
        }
예제 #10
0
        public static void construirTablaReparacionesRealizadas(DataGridView dgv_tabla)
        {
            var id          = new DataGridViewTextBoxColumn();
            var razon       = new DataGridViewTextBoxColumn();
            var nrofactura  = new DataGridViewTextBoxColumn();
            var tipo        = new DataGridViewTextBoxColumn();
            var remito      = new DataGridViewTextBoxColumn();
            var total       = new DataGridViewTextBoxColumn();
            var fecha       = new DataGridViewTextBoxColumn();
            var link        = new DataGridViewTextBoxColumn();
            var url         = new DataGridViewImageColumn();
            var cobrada     = new DataGridViewCheckBoxColumn();
            var fecha_cobro = new DataGridViewTextBoxColumn();
            var fecha_vto   = new DataGridViewTextBoxColumn();
            var vendedor    = new DataGridViewTextBoxColumn();
            var informacion = new DataGridViewImageColumn();
            var maquina     = new DataGridViewTextBoxColumn();
            var problema    = new DataGridViewTextBoxColumn();
            var documento   = new DataGridViewTextBoxColumn();


            razon.HeaderText       = "Razon Social";
            razon.DataPropertyName = "Razon Social";
            razon.Name             = "Razon Social";
            razon.ReadOnly         = true;
            razon.Width            = 200;

            maquina.HeaderText       = "Máquina";
            maquina.DataPropertyName = "Maquina";
            maquina.ReadOnly         = true;

            // problema.HeaderText = "Problema";
            //problema.DataPropertyName = "Problema";
            //problema.ReadOnly = true;

            nrofactura.HeaderText       = "Nro Factura";
            nrofactura.Name             = "Nro Factura";
            nrofactura.ReadOnly         = true;
            nrofactura.DataPropertyName = "Nro Factura";


            tipo.HeaderText       = "Tipo";
            tipo.Name             = "Tipo";
            tipo.DataPropertyName = "Tipo";
            tipo.ReadOnly         = true;


            remito.HeaderText       = "Remito";
            remito.Name             = "Remito";
            remito.DataPropertyName = "Remito";
            remito.ReadOnly         = true;

            total.HeaderText       = "Total";
            total.Name             = "Total";
            total.DataPropertyName = "Total";
            total.ReadOnly         = true;

            fecha.HeaderText       = "Fecha";
            fecha.Name             = "Fecha";
            fecha.DataPropertyName = "Fecha";
            fecha.ReadOnly         = true;

            link.HeaderText       = "Link";
            link.Name             = "Link";
            link.DataPropertyName = "Link";
            link.ReadOnly         = true;
            link.Visible          = false;

            fecha_cobro.HeaderText       = "Fecha de Cobro";
            fecha_cobro.Name             = "Fecha de Cobro";
            fecha_cobro.DataPropertyName = "Fecha de Cobro";
            fecha_cobro.ReadOnly         = true;

            cobrada.HeaderText       = "Cobrada";
            cobrada.Name             = "Cobrada";
            cobrada.DataPropertyName = "Cobrada";
            //cobrada.Visible = false;
            cobrada.ReadOnly = true;

            fecha_vto.HeaderText       = "Vencimiento";
            fecha_vto.Name             = "Vencimiento";
            fecha_vto.DataPropertyName = "Vencimiento";
            fecha_vto.ReadOnly         = true;

            vendedor.HeaderText       = "Vendedor";
            vendedor.Name             = "Vendedor";
            vendedor.DataPropertyName = "Vendedor";
            vendedor.ReadOnly         = true;

            id.HeaderText       = "Id";
            id.Name             = "Id";
            id.DataPropertyName = "Id";
            id.ReadOnly         = true;
            id.Visible          = false;

            url.Name             = "URL";
            url.HeaderText       = "URL";
            url.DataPropertyName = "URL";
            url.ReadOnly         = true;

            informacion.Name             = "Informacion";
            informacion.HeaderText       = "Info";
            informacion.DataPropertyName = "Informacion";
            informacion.ReadOnly         = true;

            documento.Name             = "Documento";
            documento.HeaderText       = "Documento";
            documento.DataPropertyName = "Documento";
            documento.ReadOnly         = true;
            documento.Visible          = false;

            dgv_tabla.Columns.AddRange(new DataGridViewColumn[] { id, razon, maquina, tipo, nrofactura, remito, total, fecha, fecha_vto, fecha_cobro, vendedor, cobrada, link, informacion, url, documento });


            dgv_tabla.AutoGenerateColumns = false;

            llenar_reparaciones_realizadas(dgv_tabla);
        }
예제 #11
0
        public static void readFinishSample(DataGridView dg, DataGridView dgSum, string testNo, DateTimePicker dtp, ZedGraph.ZedGraphControl zed)
        {
            //try
            //{
            //dg.MultiSelect = true;
            if (dg != null)
            {
                dg.DataSource = null;
                dg.Columns.Clear();
                dg.RowHeadersVisible = false;
            }
            BLL.TestSample bllTs = new HR_Test.BLL.TestSample();
            if (!string.IsNullOrEmpty(testNo))
            {
                //if (testNo.Contains('-'))
                //    testNo = testNo.Substring(0, testNo.LastIndexOf("-"));
                //获取不重复的试验编号列表
                DataSet   ds = bllTs.GetNotOverlapList(" testNo='" + testNo + "' and testDate =#" + dtp.Value.Date + "#");
                DataTable dt = ds.Tables[0];
                int       ab = 0;
                if (dt != null)
                {
                    if (dt.Rows[0]["b0"].ToString() != "0")
                    {
                        ab = 1;
                    }
                    if (dt.Rows[0]["d0"].ToString() != "0")
                    {
                        ab = 2;
                    }
                    if (dt.Rows[0]["Do"].ToString() != "0")
                    {
                        ab = 3;
                    }
                }

                DataSet   ds1 = bllTs.GetNotOverlapList1(" testNo='" + testNo + "' and testDate =#" + dtp.Value.Date + "#");
                DataTable dt1 = ds1.Tables[0];

                DataSet dsmax    = bllTs.GetMaxFm(" testNo='" + testNo + "' and testDate =#" + dtp.Value.Date + "#");
                double  maxvalue = 0;
                if (dsmax != null)
                {
                    if (!string.IsNullOrEmpty(dsmax.Tables[0].Rows[0]["Fm"].ToString()))
                    {
                        maxvalue = Convert.ToDouble(dsmax.Tables[0].Rows[0]["Fm"].ToString());
                    }
                }
                string methodName = dt1.Rows[0]["testMethodName"].ToString();
                if (dt1 != null)
                {
                    StringBuilder[] tst = strSql_T(methodName, maxvalue);
                    if (!string.IsNullOrEmpty(tst[0].ToString()) && dg != null)
                    {
                        dg.DataSource = CreateView_T(tst[0].ToString(), dt1.Rows[0]["testNo"].ToString(), ab);
                    }
                    if (!string.IsNullOrEmpty(tst[1].ToString()))
                    {
                        dgSum.DataSource = CreateAverageView(tst[0], tst[1], dt1.Rows[0]["testNo"].ToString(), ab);
                    }
                }
            }
            else
            {
                DataSet   ds = bllTs.GetFinishList(" testNo='" + testNo + "' and testDate=#" + dtp.Value.Date + "#", 0);
                DataTable dt = ds.Tables[0];
                DataRow   dr = dt.NewRow();
                dt.Rows.Add(dr);
                if (dg != null)
                {
                    dg.DataSource = dt;
                }
                ds.Dispose();
            }


            //DataGridViewDisableCheckBoxColumn chkcol = new DataGridViewDisableCheckBoxColumn();
            //DataGridViewCheckBoxColumn chkeffective = new DataGridViewCheckBoxColumn();
            //chkeffective.Name = "是否有效";
            //chkeffective.MinimumWidth = 60;
            //chkeffective.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

            DataGridViewCheckBoxColumn chkcol = new DataGridViewCheckBoxColumn();

            chkcol.Name         = "选择";
            chkcol.MinimumWidth = 50;
            chkcol.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            if (dg != null)
            {
                DataGridViewTextBoxColumn c = new DataGridViewTextBoxColumn();
                c.Name = "";
                dg.Columns.Insert(0, chkcol);
                dg.Columns.Insert(1, c);
                dg.Name = "tensile";
                //dg.Rows[0].Cells[0].Value = false;
                //dg.Rows[0].Cells[0].Selected = false;
                int rCount = dg.Rows.Count;
                for (int i = 0; i < rCount; i++)
                {
                    if (!string.IsNullOrEmpty(dg.Rows[i].Cells[2].Value.ToString()))
                    {
                        if (Convert.ToBoolean(dg.Rows[i].Cells[2].Value.ToString()) == true)
                        {
                            dg.Rows[i].DefaultCellStyle.BackColor = Color.IndianRed;
                        }
                    }
                    if (i > 19)
                    {
                        dg.Rows[i].Cells[1].Style.BackColor          = Color.FromName(_Color_Array[i % 20]);
                        dg.Rows[i].Cells[1].Style.ForeColor          = Color.FromName(_Color_Array[i % 20]);
                        dg.Rows[i].Cells[1].Style.SelectionForeColor = Color.FromName(_Color_Array[i % 20]);
                        dg.Rows[i].Cells[1].Style.SelectionBackColor = Color.FromName(_Color_Array[i % 20]);
                        dg.Rows[i].Cells[1].Value = _Color_Array[i % 20].ToString();
                    }
                    else
                    {
                        dg.Rows[i].Cells[1].Style.BackColor          = Color.FromName(_Color_Array[i]);
                        dg.Rows[i].Cells[1].Style.ForeColor          = Color.FromName(_Color_Array[i]);
                        dg.Rows[i].Cells[1].Style.SelectionBackColor = Color.FromName(_Color_Array[i]);
                        dg.Rows[i].Cells[1].Style.SelectionForeColor = Color.FromName(_Color_Array[i]);
                        dg.Rows[i].Cells[1].Value = _Color_Array[i].ToString();
                    }
                }

                foreach (DataGridViewColumn dgvc in dg.Columns)
                {
                    dgvc.SortMode = DataGridViewColumnSortMode.NotSortable;
                    dgvc.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                }
                if (dg.Columns.Count > 3)
                {
                    dg.Columns[0].Frozen = true;
                    dg.Columns[1].Frozen = true;
                    dg.Columns[2].Frozen = true;
                }
                if (dg.Columns.Count > 2)
                {
                    dg.Columns[2].Frozen = true;
                }
                dg.Refresh();
            }
            if (zed != null)
            {
                //clear all curves
                foreach (CurveItem ci in zed.GraphPane.CurveList)
                {
                    ci.Clear();
                    ci.Label.Text = "";
                }

                zed.AxisChange();
                zed.Refresh();
            }
            //}
            //catch (Exception ee) { throw ee; }
        }
예제 #12
0
파일: PieMenus.cs 프로젝트: ferbenor/moro
        public DataGridViewColumn[] ColumnasGrid()
        {
            DataGridViewTextBoxColumn colOrden = new DataGridViewTextBoxColumn()
            {
                Name             = "colOrden",
                HeaderText       = "Orden",
                DataPropertyName = "orden",
                MaxInputLength   = 2,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colIdentificador = new DataGridViewTextBoxColumn()
            {
                Name             = "colIdentificador",
                HeaderText       = "Identificador",
                DataPropertyName = "identificador",
                Width            = 80
            };

            DataGridViewTextBoxColumn colColumna = new DataGridViewTextBoxColumn()
            {
                Name             = "colColumna",
                HeaderText       = "Columna.",
                DataPropertyName = "nombre",
                Width            = 120
            };

            DataGridViewButtonXColumn colColumnaBoton = new DataGridViewButtonXColumn()
            {
                Name         = "colNombreBoton",
                HeaderText   = "<-",
                AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells,
                Tag          = "colColumna",
                Image        = General.Imagenes.Images["Listar.ico"],
                ColorTable   = DevComponents.DotNetBar.eButtonColor.Blue
            };

            DataGridViewComboBoxExColumn colTipoColumna = new DataGridViewComboBoxExColumn()
            {
                Name             = "colTipoColumna",
                HeaderText       = "Tipo columna.",
                DataPropertyName = "fktiposcolumna",
                ValueMember      = "Objeto",
                DisplayMember    = "nombre",
                FlatStyle        = FlatStyle.Flat,
                Width            = 200,
                DropDownStyle    = ComboBoxStyle.DropDownList
            };

            DataGridViewTextBoxColumn colCabecera = new DataGridViewTextBoxColumn()
            {
                Name             = "colCabecera",
                HeaderText       = "Texto Cabecera.",
                DataPropertyName = "cabecera",
                MaxInputLength   = 255,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colFormatoFecha = new DataGridViewTextBoxColumn()
            {
                Name             = "colFormatoFecha",
                HeaderText       = "Formato Fecha",
                DataPropertyName = "formatofecha",
                MaxInputLength   = 255,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewDateTimeInputColumn colFechaMinima = new DataGridViewDateTimeInputColumn()
            {
                Name             = "colFechaMinima",
                HeaderText       = "Fecha minima",
                DataPropertyName = "fechaminima",
                Format           = DevComponents.Editors.eDateTimePickerFormat.Custom,
                CustomFormat     = "yyyy-MM-dd",
                MinDate          = new DateTime(1901, 02, 01),
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colPropertyName = new DataGridViewTextBoxColumn()
            {
                Name             = "colPropertyName",
                HeaderText       = "PropertyName",
                DataPropertyName = "propertyname",
                MaxInputLength   = 255,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colValueMember = new DataGridViewTextBoxColumn()
            {
                Name             = "colValueMember",
                HeaderText       = "ValueMember",
                DataPropertyName = "valuemember",
                MaxInputLength   = 255,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colDisplayMember = new DataGridViewTextBoxColumn()
            {
                Name             = "colDisplayMember",
                HeaderText       = "DisplayMember",
                DataPropertyName = "displaymember",
                MaxInputLength   = 255,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colTag = new DataGridViewTextBoxColumn()
            {
                Name             = "colTag",
                HeaderText       = "Tag",
                DataPropertyName = "tag",
                MaxInputLength   = 255,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewComboBoxExColumn colBusqueda = new DataGridViewComboBoxExColumn()
            {
                Name             = "colBusqueda",
                HeaderText       = "Busqueda",
                DataPropertyName = "busqueda",
                //ValueMember = "Objeto",
                //DisplayMember = "nombre",
                FlatStyle     = FlatStyle.Standard,
                Width         = 130,
                DropDownStyle = ComboBoxStyle.DropDown
            };

            DataGridViewComboBoxExColumn colAlineacion = new DataGridViewComboBoxExColumn()
            {
                Name             = "colAlineacion",
                HeaderText       = "Alineacion.",
                DataPropertyName = "fkalineacion",
                ValueMember      = "Objeto",
                DisplayMember    = "nombre",
                FlatStyle        = FlatStyle.Flat,
                Width            = 100,
                DropDownStyle    = ComboBoxStyle.DropDownList
            };

            DataGridViewTextBoxColumn colWidth = new DataGridViewTextBoxColumn()
            {
                Name             = "colWidth",
                HeaderText       = "Width",
                DataPropertyName = "width",
                MaxInputLength   = 100,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewTextBoxColumn colMaxLength = new DataGridViewTextBoxColumn()
            {
                Name             = "colMaxLength",
                HeaderText       = "MaxLength",
                DataPropertyName = "maxlength",
                MaxInputLength   = 100,
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewCheckBoxColumn colReadOnly = new DataGridViewCheckBoxColumn()
            {
                Name             = "colReadOnly",
                HeaderText       = "ReadOnly",
                DataPropertyName = "sololectura",
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewCheckBoxColumn colVisible = new DataGridViewCheckBoxColumn()
            {
                Name             = "colVisible",
                HeaderText       = "Visible",
                DataPropertyName = "visible",
                AutoSizeMode     = DataGridViewAutoSizeColumnMode.AllCells
            };

            DataGridViewCheckBoxColumn colModificado = new DataGridViewCheckBoxColumn()
            {
                Name             = "colModificado",
                HeaderText       = "Modificado",
                DataPropertyName = "Modificado",
                Visible          = false
            };

            DataGridViewColumn[] listaColumnas = new DataGridViewColumn[]
            {
                colIdentificador,
                colOrden,
                colColumna,
                //colColumnaBoton,
                colTipoColumna,
                colCabecera,
                colFormatoFecha,
                colFechaMinima,
                colPropertyName,
                colValueMember,
                colDisplayMember,
                colTag,
                colBusqueda,
                colAlineacion,
                colWidth,
                colMaxLength,
                colReadOnly,
                colVisible,
                colModificado
            };
            return(listaColumnas);
        }
예제 #13
0
        private void configurarGrilla(DataSet ds)
        {
            dtgListado.Columns.Clear();
            dtgListado.AutoGenerateColumns = false;

            DataGridViewTextBoxColumn clmIdCliente = new DataGridViewTextBoxColumn();

            clmIdCliente.Width            = 30;
            clmIdCliente.ReadOnly         = true;
            clmIdCliente.DataPropertyName = "id_Cliente";
            clmIdCliente.HeaderText       = "ID";
            dtgListado.Columns.Add(clmIdCliente);

            DataGridViewTextBoxColumn clmTipoDni = new DataGridViewTextBoxColumn();

            clmTipoDni.Width            = 35;
            clmTipoDni.ReadOnly         = true;
            clmTipoDni.DataPropertyName = "Tipo_Dni";
            clmTipoDni.HeaderText       = "Tipo de Documento";
            dtgListado.Columns.Add(clmTipoDni);

            DataGridViewTextBoxColumn clmDni = new DataGridViewTextBoxColumn();

            clmDni.Width            = 30;
            clmDni.ReadOnly         = true;
            clmDni.DataPropertyName = "Dni";
            clmDni.HeaderText       = "Dni";
            dtgListado.Columns.Add(clmDni);

            DataGridViewTextBoxColumn clmCuil = new DataGridViewTextBoxColumn();

            clmCuil.Width            = 30;
            clmCuil.ReadOnly         = true;
            clmCuil.DataPropertyName = "Cuil";
            clmCuil.HeaderText       = "Cuil";
            dtgListado.Columns.Add(clmCuil);

            DataGridViewTextBoxColumn clmApellido = new DataGridViewTextBoxColumn();

            clmApellido.ReadOnly         = true;
            clmApellido.DataPropertyName = "Apellido";
            clmApellido.HeaderText       = "Apellido";
            dtgListado.Columns.Add(clmApellido);

            DataGridViewTextBoxColumn clmNombre = new DataGridViewTextBoxColumn();

            clmNombre.ReadOnly         = true;
            clmNombre.DataPropertyName = "Nombre";
            clmNombre.HeaderText       = "Nombre";
            dtgListado.Columns.Add(clmNombre);

            DataGridViewTextBoxColumn clmFechaNac = new DataGridViewTextBoxColumn();

            clmFechaNac.Width            = 80;
            clmFechaNac.ReadOnly         = true;
            clmFechaNac.DataPropertyName = "Fecha_nac";
            clmFechaNac.HeaderText       = "Fecha de Nacimiento";
            dtgListado.Columns.Add(clmFechaNac);

            DataGridViewTextBoxColumn clmMail = new DataGridViewTextBoxColumn();

            clmMail.ReadOnly         = true;
            clmMail.DataPropertyName = "Mail";
            clmMail.HeaderText       = "Mail";
            dtgListado.Columns.Add(clmMail);

            DataGridViewTextBoxColumn clmTelefono = new DataGridViewTextBoxColumn();

            clmTelefono.ReadOnly         = true;
            clmTelefono.DataPropertyName = "Telefono";
            clmTelefono.HeaderText       = "Teléfono";
            dtgListado.Columns.Add(clmTelefono);

            DataGridViewTextBoxColumn clmDireccion = new DataGridViewTextBoxColumn();

            clmDireccion.Width            = 80;
            clmDireccion.ReadOnly         = true;
            clmDireccion.DataPropertyName = "Direccion";
            clmDireccion.HeaderText       = "Dirección";
            dtgListado.Columns.Add(clmDireccion);

            DataGridViewTextBoxColumn clmCiudad = new DataGridViewTextBoxColumn();

            clmCiudad.ReadOnly         = true;
            clmCiudad.DataPropertyName = "Dom_ciudad";
            clmCiudad.HeaderText       = "Ciudad";
            dtgListado.Columns.Add(clmCiudad);

            DataGridViewTextBoxColumn clmCodigoPostal = new DataGridViewTextBoxColumn();

            clmCodigoPostal.ReadOnly         = true;
            clmCodigoPostal.DataPropertyName = "Dom_cod_postal";
            clmCodigoPostal.HeaderText       = "Código Postal";
            dtgListado.Columns.Add(clmCodigoPostal);

            DataGridViewCheckBoxColumn clmActivo = new DataGridViewCheckBoxColumn();

            clmActivo.Width            = 60;
            clmActivo.ReadOnly         = true;
            clmActivo.DataPropertyName = "Activo";
            clmActivo.HeaderText       = "Activo";
            dtgListado.Columns.Add(clmActivo);

            dtgListado.DataSource          = ds.Tables[0];
            dtgListado.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }
예제 #14
0
        private void setupDataGridView()
        {
            // configure for readonly

            dataGridViewClients.SelectionMode                      = DataGridViewSelectionMode.FullRowSelect;
            dataGridViewClients.MultiSelect                        = false;
            dataGridViewClients.AllowUserToAddRows                 = false;
            dataGridViewClients.EditMode                           = DataGridViewEditMode.EditProgrammatically;
            dataGridViewClients.AllowUserToOrderColumns            = false;
            dataGridViewClients.AllowUserToResizeColumns           = false;
            dataGridViewClients.AllowUserToResizeRows              = false;
            dataGridViewClients.ColumnHeadersDefaultCellStyle.Font = new Font(DataGridView.DefaultFont, FontStyle.Bold);

            //// add columns

            DataGridViewTextBoxColumn clientCode = new DataGridViewTextBoxColumn();

            clientCode.Name                       = "clientCode";
            clientCode.DataPropertyName           = "ClientCode"; //has to match the Property Method name exactly
            clientCode.HeaderText                 = "Client Code";
            clientCode.Width                      = 70;
            clientCode.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            clientCode.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            clientCode.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(clientCode);

            DataGridViewTextBoxColumn companyName = new DataGridViewTextBoxColumn();

            companyName.Name                       = "companyName";
            companyName.DataPropertyName           = "CompanyName";
            companyName.HeaderText                 = "Company Name";
            companyName.Width                      = 160;
            companyName.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            companyName.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            companyName.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(companyName);

            DataGridViewTextBoxColumn address1 = new DataGridViewTextBoxColumn();

            address1.Name                       = "address1";
            address1.DataPropertyName           = "Address1";
            address1.HeaderText                 = "Address";
            address1.Width                      = 160;
            address1.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            address1.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            address1.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(address1);

            //DataGridViewTextBoxColumn address2 = new DataGridViewTextBoxColumn();
            //address2.Name = "address2";
            //address2.DataPropertyName = "Address2";
            //address2.HeaderText = "Address2";
            //address2.Width = 160;
            //address2.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            //address2.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            //address2.SortMode = DataGridViewColumnSortMode.NotSortable;
            //dataGridViewClients.Columns.Add(address2);

            DataGridViewTextBoxColumn city = new DataGridViewTextBoxColumn();

            city.Name                       = "city";
            city.DataPropertyName           = "City";
            city.HeaderText                 = "City";
            city.Width                      = 60;
            city.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            city.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            city.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(city);

            DataGridViewTextBoxColumn postalCode = new DataGridViewTextBoxColumn();

            postalCode.Name                       = "postalCode";
            postalCode.DataPropertyName           = "PostalCode";
            postalCode.HeaderText                 = "Postal Code";
            postalCode.Width                      = 60;
            postalCode.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            postalCode.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            postalCode.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(postalCode);

            DataGridViewTextBoxColumn ytdsales = new DataGridViewTextBoxColumn();

            ytdsales.Name                       = "ytdsales";
            ytdsales.DataPropertyName           = "YTDSales";
            ytdsales.HeaderText                 = "YTDSales";
            ytdsales.Width                      = 70;
            ytdsales.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            ytdsales.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            ytdsales.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(ytdsales);

            DataGridViewTextBoxColumn notes = new DataGridViewTextBoxColumn();

            notes.Name                       = "notes";
            notes.DataPropertyName           = "Notes";
            notes.HeaderText                 = "Notes";
            notes.Width                      = 100;
            notes.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            notes.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            notes.SortMode                   = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(notes);

            DataGridViewCheckBoxColumn creditHold = new DataGridViewCheckBoxColumn();

            creditHold.Name             = "creditHold";
            creditHold.DataPropertyName = "CreditHold";
            creditHold.HeaderText       = "Credit Hold";
            creditHold.Width            = 50;
            //       creditHold.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            //      creditHold.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            //looks better without the middle alightment
            creditHold.SortMode = DataGridViewColumnSortMode.NotSortable;
            dataGridViewClients.Columns.Add(creditHold);
        }
예제 #15
0
파일: Banorte.cs 프로젝트: MH3Dapesa/Dapesa
        private void Procesar(string loRutaArchivoMovimientos, int lnIniciarLecturaMovimientos, string loRutaArchivoCodigosMovimientos)
        {
            Cursor.Current = Cursors.WaitCursor;
            this.Enabled   = false;
            DataGridViewCheckBoxColumn loAgregaCheck = new DataGridViewCheckBoxColumn();

            lblProcesados.Text     = "0";
            lblImporteCargado.Text = "$ 00.00";

            psArchivo = loRutaArchivoMovimientos;
            gvExistentes.DataSource = null;

            try
            {
                txtArchivo.Text = loRutaArchivoMovimientos;

                #region Filtrar datos solo abonos.
                DataTable poMovimientos = LeerArchivo(loRutaArchivoMovimientos, lnIniciarLecturaMovimientos);
                lblEstatus.Text = "Registros Procesados: " + poMovimientos.Rows.Count.ToString();
                #endregion

                if (gvMovimientosCorrectos.Columns.Count < 1)
                {
                    loAgregaCheck = new DataGridViewCheckBoxColumn();
                    CheckBoxHeaderCell loCheckheader = new CheckBoxHeaderCell();
                    loCheckheader.OnCheckBoxHeaderClick += loCheckheader_OnCheckBoxHeaderClick;
                    loAgregaCheck.HeaderCell             = loCheckheader;
                    gvMovimientosCorrectos.Columns.Insert(0, loAgregaCheck);
                }

                if (gvMovimientosErrores.Columns.Count < 1)
                {
                    loAgregaCheck       = new DataGridViewCheckBoxColumn();
                    loAgregaCheck.Width = 1;
                    gvMovimientosErrores.Columns.Insert(0, loAgregaCheck);
                    this.gvMovimientosErrores.Columns[0].Resizable = 0;
                }

                poMovimientos.Columns.Add("Tipo_pago", typeof(string));
                poMovimientos.Columns.Add("Suc", typeof(string));
                poMovimientos.Columns.Add("Cliente", typeof(string));
                poMovimientos.Columns.Add("#", typeof(int));
                poMovimientos.Columns.Add("Forma_Pago", typeof(string));
                poMovimientos.Columns.Add("Sucursal", typeof(string));
                poMovimientos.Columns.Add("Status", typeof(string));

                obtenerFormaDePago(poMovimientos);

                pbMovimientos.Minimum = 1;
                pbMovimientos.Maximum = poMovimientos.Rows.Count;
                pbMovimientos.Value   = 1;
                pbMovimientos.Step    = 1;

                poMovimientos = GenerarVista(poMovimientos);
                this.gvMovimientosCorrectos.DataSource = ObtenerSucursal(ValidaCobro(poMovimientos));

                gvMovimientosCorrectos.Columns["#"].DisplayIndex = 1;
                gvMovimientosErrores.Columns["#"].DisplayIndex   = 1;

                this.gvMovimientosCorrectos.Columns["Columna10"].Visible  = false;
                this.gvMovimientosCorrectos.Columns["Forma_Pago"].Visible = false;
                this.gvMovimientosCorrectos.Columns["Suc"].Visible        = false;
                this.gvMovimientosCorrectos.Columns["Status"].Visible     = false;

                this.gvMovimientosErrores.Columns["Columna10"].Visible  = false;
                this.gvMovimientosErrores.Columns["Forma_Pago"].Visible = false;
                this.gvMovimientosErrores.Columns["Suc"].Visible        = false;
                this.gvMovimientosErrores.Columns["Status"].Visible     = false;

                for (int ln = 1; ln < gvMovimientosCorrectos.Columns.Count; ln++)
                {
                    gvMovimientosCorrectos.Columns[ln].ReadOnly = true;
                }

                MessageBox.Show("Archivo procesado correctamente.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\nFuente: " + ex.Source, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                this.Enabled   = true;
            }
        }
예제 #16
0
        private void button1_Click(object sender, EventArgs e)
        {
            //try
            //  {
            if (!string.IsNullOrEmpty(textBox4.Text))
            {
                string y;
                y = label10.Text;
                int v;
                v   = Convert.ToInt32(y);
                cmd = new SqlCommand("select name,nationalId from student where nationalId='" + textBox4.Text + "' and restricted='" + '1' + "'", cn);

                cn.Open();
                dr = cmd.ExecuteReader();

                if (dr.Read())
                {
                    name       = dr[0].ToString();
                    nationalid = dr[1].ToString();
                    dr.Close();
                    cm = new SqlCommand("select count(*) from registeration where nationalId='" + nationalid + "' and [year]=" + v + " and semester='" + label11.Text + "'", cn);
                    dv = cm.ExecuteReader();
                    dv.Read();
                    string h = dv[0].ToString();
                    int    r = Convert.ToInt32(h);
                    dv.Close();
                    cn.Close();
                    ci = new SqlCommand("select count(*) from selection where nationalId='" + nationalid + "'", cn);
                    cn.Open();
                    dv = ci.ExecuteReader();
                    dv.Read();
                    string p = dv[0].ToString();
                    int    w;
                    w = Convert.ToInt32(p);
                    dv.Close();
                    cn.Close();
                    if (w > 0)
                    {    //رسالة يتم الان التسجيل بنفس الرقم
                        MessageBox.Show(" يتم الان التسجيل بنفس الرقم", "رسالة", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        textBox4.Clear();
                    }
                    else
                    {
                        if (r != 0)
                        {
                            //فى حالة ان الطالب مسجل من قبل
                            textBox2.Hide();
                            button1.Hide();
                            label7.Hide();
                            label8.Text       = "تم التسجيل من قبل";
                            this.Size         = new Size(659, 249);
                            textBox4.ReadOnly = true;
                        }
                        else
                        {
                            //فى حالة ان الطالب غير مسجل من قبل
                            int    year   = Convert.ToInt32(label10.Text);
                            string seme   = label11.Text;
                            double decide = 0;
                            int    test   = 0;
                            cmd = new SqlCommand("select count(gpa) from totalgpa where nationalid='" + nationalid + "' ", cn);
                            cn.Open();
                            dv = cmd.ExecuteReader();
                            dv.Read();
                            test = Convert.ToInt32(dv[0].ToString());
                            dv.Close();
                            cn.Close();
                            if (test != 0)
                            {
                                if (seme == "first")
                                {
                                    year = year - 1;
                                    cmd  = new SqlCommand("exec sumgpa2 where @idofstudent='" + nationalid + "' and year=" + year + " ", cn);
                                    cn.Open();
                                    dv = cmd.ExecuteReader();
                                    dv.Read();
                                    decide = Convert.ToDouble(dv[0].ToString());
                                    dv.Close();
                                    cn.Close();
                                }
                                if (seme == "second")
                                {
                                    seme = "first";
                                    cmd  = new SqlCommand("select gpa from totalgpa where nationalid='" + nationalid + "' and year=" + year + " and semester='" + seme + "'", cn);
                                    cn.Open();
                                    dv = cmd.ExecuteReader();
                                    dv.Read();
                                    string bv = dv[0].ToString();
                                    dv.Close();
                                    cn.Close();
                                    decide = Convert.ToDouble(bv);
                                }
                                if (seme == "summer")
                                {
                                    seme = "second";
                                    cmd  = new SqlCommand("select gpa from totalgpa where nationalid='" + nationalid + "' and year=" + year + " and semester='" + seme + "'", cn);
                                    cn.Open();
                                    dv = cmd.ExecuteReader();
                                    dv.Read();
                                    decide = Convert.ToDouble(dv[0].ToString());
                                    dv.Close();
                                    cn.Close();
                                }
                            }
                            else
                            {
                                decide = 100;
                            }
                            if (decide == 100)
                            {
                                label4.Text = "14";
                                label6.Text = "18";
                            }
                            if (decide < 2)
                            {
                                label4.Text = "14";
                                label6.Text = "18";
                            }
                            if ((decide >= 2) && (decide < 3))
                            {
                                label4.Text = "18";
                                label6.Text = "18";
                            }
                            //كمل باقى الحالات



                            Da = new SqlDataAdapter("exec register @idstudent='" + nationalid + "'", cn);
                            ds = new DataSet();
                            Da.Fill(ds);
                            dataGridView1.DataSource = ds.Tables[0];
                            dataGridView2.DataSource = ds.Tables[1];
                            ca = new SqlCommand("select name from student where nationalId='" + nationalid + "' ", cn);
                            cn.Open();
                            dr = ca.ExecuteReader();
                            dr.Read();
                            textBox2.Text = dr[0].ToString();
                            dr.Close();
                            cn.Close();
                            DataGridViewCheckBoxColumn sb = new DataGridViewCheckBoxColumn();
                            sb.HeaderText = "select";
                            dataGridView1.Columns.Add(sb);
                            if (dataGridView1.ColumnCount == 3)
                            {
                                dataGridView1.Columns.RemoveAt(2);
                            }
                            dataGridView1.Columns[0].ReadOnly = true;

                            for (int m = dataGridView1.Rows.Count - 1; m >= 0; m--)
                            {
                                dataGridView1.Rows[m].Cells[1].Value = false;
                            }

                            if (dataGridView2.Rows.Count == 0)
                            {
                                dataGridView2.Visible = false;
                            }
                            else
                            {
                                dataGridView2.Visible = true;
                                DataGridViewCheckBoxColumn sa = new DataGridViewCheckBoxColumn();
                                sa.HeaderText = "select";
                                dataGridView2.Columns.Add(sa);
                                if (dataGridView2.ColumnCount >= 3)
                                {
                                    dataGridView2.Columns.RemoveAt(2);
                                }
                                dataGridView2.Columns[0].ReadOnly = true;
                                for (int m = dataGridView2.Rows.Count - 1; m >= 0; m--)
                                {
                                    dataGridView2.Rows[m].Cells[1].Value = false;
                                }
                            }

                            button1.Visible = false;
                            button6.Hide();
                            button5.Hide();
                            label8.Hide();
                            button4.Hide();
                            this.Size         = new Size(659, 563);
                            textBox4.ReadOnly = true;
                            dr.Close();
                        }
                        //............
                    }
                }

                else
                {
                    //فى حالة ان الرقم غير متاح او لم يدخل رقم للطالب من الاساس
                    MessageBox.Show("من فضللك ادخل رقم الجلوس الصحيح", "رسالة", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    textBox4.Clear();
                    dr.Close();
                    cn.Close();
                }
            }

            /*    }
             *
             *
             *
             *     //--
             *  catch
             *  {
             *      MessageBox.Show("من فضللك التاكد من الاتصال بقاعده البيانات ", "رسالة", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             *  }*/
        }
예제 #17
0
        private void dtgMetroGrid1()
        {
            int cntStandardMenu = 13;

            metroGrid1.Rows.Clear();
            metroGrid1.RowHeadersVisible = false;

            DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();

            metroGrid1.Columns.Add(chk);
            chk.HeaderText = "선택";

            metroGrid1.ColumnCount = mainFrm.CompetitionData.GetLength(1) - cntStandardMenu + 2;
            metroGrid1.ScrollBars  = ScrollBars.Horizontal;
            metroGrid1.DefaultCellStyle.WrapMode = DataGridViewTriState.False;

            metroGrid1.DefaultCellStyle.Font = new Font("나눔고딕", 10);

            metroGrid1.Columns[1].Name = "무기명";


            // 개요
            metroGrid1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(32, 56, 100);
            metroGrid1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            for (int i = 2; i < metroGrid1.Columns.Count; i++)
            {
                metroGrid1.Columns[i].Name = mainFrm.CompetitionData[0, i + cntStandardMenu - 2].ToString();

                metroGrid1.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                metroGrid1.Columns[i].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;

                metroGrid1.Columns[i].Resizable = DataGridViewTriState.False;

                metroGrid1.Columns[i].DefaultCellStyle.WrapMode = DataGridViewTriState.False;
            }
            ////// DB에 있는 무기체계들을 다 읽어와서 뿌려줌
            string[] CompetitionWeapon = new string[mainFrm.CompetitionData.GetLength(0)];
            for (int i = 1; i < mainFrm.CompetitionData.GetLength(0); i++)
            {
                CompetitionWeapon[i - 1] = mainFrm.CompetitionData[i, 3].ToString();
            }
            CompetitionWeapon = CompetitionWeapon.Where(condition => condition != null).ToArray();

            for (int i = 0; i < Competition2.RawWeaponDBData.Length; i++)
            {
                bool isSimilarWeapon = Competition2.isSimilarWeapon[i] == true ? false : true;
                if (isSimilarWeapon == true)
                {
                    metroGrid1.Rows.Add(false);
                    metroGrid1.Rows[i].Cells[1].Value = Competition2.RawWeaponDBData[i];
                    for (int j = 2; j < metroGrid1.ColumnCount; j++)
                    {
                        int WeaponIndex = Array.IndexOf(CompetitionWeapon, metroGrid1.Rows[i].Cells[1].Value.ToString());

                        metroGrid1.Rows[i].Cells[j].Value = mainFrm.CompetitionData[WeaponIndex + 1, j + cntStandardMenu - 2];
                    }
                }
            }
            //////////////////////////////////////////////////

            this.metroGrid1.DefaultCellStyle.Font = new Font("나눔고딕", 9);

            for (int i = 0; i < metroGrid1.RowCount; i++)
            {
                metroGrid1.Rows[i].DefaultCellStyle.BackColor = Color.White;
                metroGrid1.Rows[i].DefaultCellStyle.WrapMode  = DataGridViewTriState.False;

                metroGrid1.Rows[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            }
            for (int i = 1; i < metroGrid1.ColumnCount; i++)
            {
                metroGrid1.Columns[i].Width        = 500;
                metroGrid1.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                metroGrid1.Columns[i].DefaultCellStyle.WrapMode = DataGridViewTriState.False;

                metroGrid1.Columns[i].ReadOnly = true;
            }
            int X = metroGrid1.ColumnHeadersHeight + metroGrid1.Rows.Cast <DataGridViewRow>().Sum(r => r.Height);

            metroGrid1.Height = X + 18;

            metroGrid1.CurrentCell      = null;
            metroGrid1.Columns[0].Width = 50;

            metroButton1.Location = new Point(metroButton1.Location.X, metroGrid1.Location.Y + metroGrid1.Height + 50);

            //전체 폼 크기 변경
            this.Size = new Size(this.Size.Width, metroGrid1.Height + metroButton1.Height + 150);
            this.CenterToScreen();
        }
예제 #18
0
        /// <summary>
        /// Обязательный метод для поддержки конструктора - не изменяйте содержимое данного метода при помощи редактора кода.
        /// </summary>
        private void InitializeComponent()
        {
            //
            // components
            //
            this.components = new Container();
            //
            // timer
            //
            this.timer          = new Timer(this.components);
            this.timer.Interval = 10000;
            this.timer.Tick    += new EventHandler(this.timer_Tick);
            //
            // lblLists
            //
            this.lblLists          = new Label();
            this.lblLists.AutoSize = true;
            this.lblLists.Size     = new Size(78, 13);
            this.lblLists.Location = new Point(6, 21);
            this.lblLists.TabIndex = 19;
            this.lblLists.Name     = "lblLists";
            this.lblLists.Text     = "Списков (шт.):";
            //
            // lblInterval
            //
            this.lblInterval          = new Label();
            this.lblInterval.AutoSize = true;
            this.lblInterval.Size     = new Size(99, 13);
            this.lblInterval.Location = new Point(6, 81);
            this.lblInterval.TabIndex = 21;
            this.lblInterval.Name     = "lblInterval";
            this.lblInterval.Text     = "Автозапуск (сек.):";
            //
            // btnExecute
            //
            this.btnExecute          = new Button();
            this.btnExecute.Size     = new Size(285, 30);
            this.btnExecute.Location = new Point(6, 19);
            this.btnExecute.TabIndex = 0;
            this.btnExecute.UseVisualStyleBackColor = true;
            this.btnExecute.Name   = "btnExecute";
            this.btnExecute.Text   = "Запустить";
            this.btnExecute.Click += new EventHandler(this.btnExecute_Click);
            //
            // btnClearLog
            //
            this.btnClearLog          = new Button();
            this.btnClearLog.Size     = new Size(708, 30);
            this.btnClearLog.Location = new Point(6, 187);
            this.btnClearLog.TabIndex = 0;
            this.btnClearLog.UseVisualStyleBackColor = true;
            this.btnClearLog.Name   = "btnClearLog";
            this.btnClearLog.Text   = "Очистить";
            this.btnClearLog.Click += new EventHandler(this.btnClearLog_Click);
            //
            // lblError
            //
            this.lblError          = new Label();
            this.lblError.AutoSize = true;
            this.lblError.Size     = new Size(58, 13);
            this.lblError.Location = new Point(6, 85);
            this.lblError.TabIndex = 2;
            this.lblError.Name     = "lblError";
            this.lblError.Text     = "В ошибки:";
            //
            // lblEnd
            //
            this.lblEnd          = new Label();
            this.lblEnd.AutoSize = true;
            this.lblEnd.Size     = new Size(58, 13);
            this.lblEnd.Location = new Point(6, 51);
            this.lblEnd.TabIndex = 2;
            this.lblEnd.Name     = "lblEnd";
            this.lblEnd.Text     = "До конца:";
            //
            // lblNormal
            //
            this.lblNormal          = new Label();
            this.lblNormal.AutoSize = true;
            this.lblNormal.Size     = new Size(74, 13);
            this.lblNormal.Location = new Point(6, 18);
            this.lblNormal.TabIndex = 2;
            this.lblNormal.Name     = "lblNormal";
            this.lblNormal.Text     = "Нормальная:";
            //
            // rbNormal
            //
            this.rbNormal          = new RadioButton();
            this.rbNormal.AutoSize = true;
            this.rbNormal.Checked  = true;
            this.rbNormal.Size     = new Size(14, 13);
            this.rbNormal.Location = new Point(110, 18);
            this.rbNormal.TabStop  = true;
            this.rbNormal.TabIndex = 0;
            this.rbNormal.UseVisualStyleBackColor = true;
            this.rbNormal.Name            = "rbNormal";
            this.rbNormal.CheckedChanged += new EventHandler(this.rbCommon_CheckedChanged);
            //
            // rbEnd
            //
            this.rbEnd          = new RadioButton();
            this.rbEnd.AutoSize = true;
            this.rbEnd.Size     = new Size(14, 13);
            this.rbEnd.Location = new Point(110, 51);
            this.rbEnd.TabStop  = true;
            this.rbEnd.TabIndex = 1;
            this.rbEnd.UseVisualStyleBackColor = true;
            this.rbEnd.Name            = "rbEnd";
            this.rbEnd.CheckedChanged += new EventHandler(this.rbCommon_CheckedChanged);
            //
            // rbError
            //
            this.rbError          = new RadioButton();
            this.rbError.AutoSize = true;
            this.rbError.Size     = new Size(14, 13);
            this.rbError.Location = new Point(110, 85);
            this.rbError.TabStop  = true;
            this.rbError.TabIndex = 2;
            this.rbError.UseVisualStyleBackColor = true;
            this.rbError.Name            = "rbError";
            this.rbError.CheckedChanged += new EventHandler(this.rbCommon_CheckedChanged);
            //
            // gbLog
            //
            this.gbLog = new GroupBox();
            this.gbLog.SuspendLayout();
            this.gbLog.Controls.Add(this.rtbLog);
            this.gbLog.Controls.Add(this.btnClearLog);
            this.gbLog.Size     = new Size(720, 220);
            this.gbLog.Location = new Point(201, 12);
            this.gbLog.TabStop  = false;
            this.gbLog.TabIndex = 3;
            this.gbLog.Name     = "gbLog";
            this.gbLog.Text     = "Протокол";
            this.gbLog.ResumeLayout(false);
            this.gbLog.PerformLayout();
            //
            // rtbLog
            //
            this.rtbLog            = new RichTextBox();
            this.rtbLog.Size       = new Size(708, 169);
            this.rtbLog.Location   = new Point(6, 15);
            this.rtbLog.ReadOnly   = true;
            this.rtbLog.ScrollBars = RichTextBoxScrollBars.ForcedBoth;
            this.rtbLog.TabIndex   = 1;
            this.rtbLog.Name       = "rtbLog";
            this.rtbLog.Text       = String.Empty;
            //
            // numCount
            //
            this.numCount = new NumericUpDown();
            this.numCount.BeginInit();
            this.numCount.Minimum       = 5;
            this.numCount.Maximum       = 750;
            this.numCount.Increment     = 5;
            this.numCount.Value         = 50;
            this.numCount.Size          = new Size(45, 20);
            this.numCount.Location      = new Point(141, 49);
            this.numCount.ReadOnly      = true;
            this.numCount.TabIndex      = 3;
            this.numCount.TextAlign     = HorizontalAlignment.Right;
            this.numCount.Name          = "numCount";
            this.numCount.ValueChanged += new EventHandler(this.numCommon_ValueChanged);
            this.numCount.EndInit();
            //
            // rbCount
            //
            this.rbCount          = new RadioButton();
            this.rbCount.AutoSize = true;
            this.rbCount.Size     = new Size(14, 13);
            this.rbCount.Location = new Point(110, 51);
            this.rbCount.TabIndex = 2;
            this.rbCount.UseVisualStyleBackColor = true;
            this.rbCount.Name = "rbCount";
            //
            // lblCount
            //
            this.lblCount          = new Label();
            this.lblCount.AutoSize = true;
            this.lblCount.Size     = new Size(71, 13);
            this.lblCount.Location = new Point(6, 51);
            this.lblCount.TabIndex = 10;
            this.lblCount.Name     = "lblCount";
            this.lblCount.Text     = "Строк (тыс.):";
            //
            // rbLists
            //
            this.rbLists          = new RadioButton();
            this.rbLists.Checked  = true;
            this.rbLists.AutoSize = true;
            this.rbLists.Size     = new Size(14, 13);
            this.rbLists.Location = new Point(110, 21);
            this.rbLists.TabStop  = true;
            this.rbLists.TabIndex = 0;
            this.rbLists.UseVisualStyleBackColor = true;
            this.rbLists.Name            = "rbLists";
            this.rbLists.CheckedChanged += new EventHandler(this.rbCommon_CheckedChanged);
            //
            // cbAutoExec
            //
            this.cbAutoExec          = new CheckBox();
            this.cbAutoExec.AutoSize = true;
            this.cbAutoExec.Size     = new Size(15, 14);
            this.cbAutoExec.Location = new Point(110, 81);
            this.cbAutoExec.TabIndex = 4;
            this.cbAutoExec.UseVisualStyleBackColor = true;
            this.cbAutoExec.Name            = "cbAutoExec";
            this.cbAutoExec.CheckedChanged += new EventHandler(this.cbAutoExec_CheckedChanged);
            //
            // numLists
            //
            this.numLists = new NumericUpDown();
            this.numLists.BeginInit();
            this.numLists.Minimum       = 5;
            this.numLists.Maximum       = 350;
            this.numLists.Increment     = 5;
            this.numLists.Value         = 75;
            this.numLists.Size          = new Size(45, 20);
            this.numLists.Location      = new Point(141, 19);
            this.numLists.ReadOnly      = true;
            this.numLists.TabIndex      = 1;
            this.numLists.TextAlign     = HorizontalAlignment.Right;
            this.numLists.Name          = "numLists";
            this.numLists.ValueChanged += new EventHandler(this.numCommon_ValueChanged);
            this.numLists.EndInit();
            //
            // numTimer
            //
            this.numTimer = new NumericUpDown();
            this.numTimer.BeginInit();
            this.numTimer.Minimum       = 5;
            this.numTimer.Maximum       = 300;
            this.numTimer.Increment     = 5;
            this.numTimer.Value         = 25;
            this.numTimer.Size          = new Size(45, 20);
            this.numTimer.Location      = new Point(141, 79);
            this.numTimer.ReadOnly      = true;
            this.numTimer.TabIndex      = 5;
            this.numTimer.TextAlign     = HorizontalAlignment.Right;
            this.numTimer.Name          = "numTimer";
            this.numTimer.ValueChanged += new EventHandler(this.numCommon_ValueChanged);
            this.numTimer.EndInit();
            //
            // btnSettings
            //
            this.btnSettings          = new Button();
            this.btnSettings.Size     = new Size(286, 30);
            this.btnSettings.Location = new Point(626, 19);
            this.btnSettings.TabIndex = 2;
            this.btnSettings.UseVisualStyleBackColor = true;
            this.btnSettings.Name   = "btnSettings";
            this.btnSettings.Text   = "Настройки";
            this.btnSettings.Click += new EventHandler(this.btnSettings_Click);
            //
            // bgWorker
            //
            this.bgWorker = new BackgroundWorker();
            this.bgWorker.WorkerReportsProgress      = true;
            this.bgWorker.WorkerSupportsCancellation = true;
            this.bgWorker.DoWork             += new DoWorkEventHandler(this.bgWorker_DoWork);
            this.bgWorker.ProgressChanged    += new ProgressChangedEventHandler(this.bgWorker_ProgressChanged);
            this.bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.bgWorker_RunWorkerCompleted);
            //
            // dgvCheck
            //
            this.dgvCheck              = new DataGridViewCheckBoxColumn();
            this.dgvCheck.Resizable    = DataGridViewTriState.True;
            this.dgvCheck.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;
            this.dgvCheck.Width        = 68;
            this.dgvCheck.HeaderText   = "Обработка";
            this.dgvCheck.Name         = "dgvCheck";
            //
            // dgvLSTType
            //
            this.dgvLSTType                  = new DataGridViewTextBoxColumn();
            this.dgvLSTType.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvLSTType.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvLSTType.HeaderText       = "Тип списка";
            this.dgvLSTType.DataPropertyName = "LSTType";
            this.dgvLSTType.ReadOnly         = true;
            this.dgvLSTType.Name             = "dgvLSTType";
            //
            // dgvCNTNew
            //
            this.dgvCNTNew                  = new DataGridViewTextBoxColumn();
            this.dgvCNTNew.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvCNTNew.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvCNTNew.HeaderText       = "Новые\n(списков / строк)";
            this.dgvCNTNew.DataPropertyName = "CNTNew";
            this.dgvCNTNew.ReadOnly         = true;
            this.dgvCNTNew.Name             = "dgvCNTNew";
            //
            // dgvCNTPartial
            //
            this.dgvCNTPartial                  = new DataGridViewTextBoxColumn();
            this.dgvCNTPartial.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvCNTPartial.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvCNTPartial.HeaderText       = "Частичные\n(списков / строк)";
            this.dgvCNTPartial.DataPropertyName = "CNTPartial";
            this.dgvCNTPartial.ReadOnly         = true;
            this.dgvCNTPartial.Name             = "dgvCNTPartial";
            //
            // dgvCNTProcess
            //
            this.dgvCNTProcess                  = new DataGridViewTextBoxColumn();
            this.dgvCNTProcess.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvCNTProcess.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvCNTProcess.HeaderText       = "Обрабатываются\n(списков / строк)";
            this.dgvCNTProcess.DataPropertyName = "CNTProcess";
            this.dgvCNTProcess.ReadOnly         = true;
            this.dgvCNTProcess.Name             = "dgvCNTProcess";
            //
            // dgvCNTTerminate
            //
            this.dgvCNTTerminate                  = new DataGridViewTextBoxColumn();
            this.dgvCNTTerminate.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvCNTTerminate.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvCNTTerminate.HeaderText       = "Прерванные\n(списков / строк)";
            this.dgvCNTTerminate.DataPropertyName = "CNTTerminate";
            this.dgvCNTTerminate.ReadOnly         = true;
            this.dgvCNTTerminate.Name             = "dgvCNTTerminate";
            //
            // dgvWRKNormal
            //
            this.dgvWRKNormal                  = new DataGridViewTextBoxColumn();
            this.dgvWRKNormal.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvWRKNormal.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvWRKNormal.HeaderText       = "В нормальную\n(списков / строк)";
            this.dgvWRKNormal.DataPropertyName = "WRKNormal";
            this.dgvWRKNormal.ReadOnly         = true;
            this.dgvWRKNormal.Name             = "dgvWRKNormal";
            //
            // dgvWRKEnd
            //
            this.dgvWRKEnd                  = new DataGridViewTextBoxColumn();
            this.dgvWRKEnd.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvWRKEnd.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvWRKEnd.HeaderText       = "До конца\n(списков / строк)";
            this.dgvWRKEnd.DataPropertyName = "WRKEnd";
            this.dgvWRKEnd.ReadOnly         = true;
            this.dgvWRKEnd.Name             = "dgvWRKEnd";
            //
            // dgvWRKError
            //
            this.dgvWRKError                  = new DataGridViewTextBoxColumn();
            this.dgvWRKError.SortMode         = DataGridViewColumnSortMode.NotSortable;
            this.dgvWRKError.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            this.dgvWRKError.HeaderText       = "В ошибки\n(списков / строк)";
            this.dgvWRKError.DataPropertyName = "WRKError";
            this.dgvWRKError.ReadOnly         = true;
            this.dgvWRKError.Name             = "dgvWRKError";
            //
            // gbLists
            //
            this.gbLists = new GroupBox();
            this.gbLists.SuspendLayout();
            this.gbLists.Size     = new Size(918, 238);
            this.gbLists.Location = new Point(3, 238);
            this.gbLists.Controls.Add(this.dgvLists);
            this.gbLists.TabIndex = 7;
            this.gbLists.TabStop  = false;
            this.gbLists.Name     = "gbLists";
            this.gbLists.Text     = "Списки";
            this.gbLists.ResumeLayout(false);
            this.gbLists.PerformLayout();
            //
            // btnRefresh
            //
            this.btnRefresh          = new Button();
            this.btnRefresh.Size     = new Size(285, 30);
            this.btnRefresh.Location = new Point(316, 19);
            this.btnRefresh.TabIndex = 1;
            this.btnRefresh.UseVisualStyleBackColor = true;
            this.btnRefresh.Name   = "btnRefresh";
            this.btnRefresh.Text   = "Обновить";
            this.btnRefresh.Click += new EventHandler(this.btnRefresh_Click);
            //
            // lblProgress
            //
            this.lblProgress      = new ToolStripStatusLabel();
            this.lblProgress.Size = new Size(63, 17);
            this.lblProgress.Name = "lblProgress";
            this.lblProgress.Text = "Прогресс:";
            //
            // pbProgress
            //
            this.pbProgress          = new ToolStripProgressBar();
            this.pbProgress.AutoSize = false;
            this.pbProgress.Size     = new Size(475, 16);
            this.pbProgress.Name     = "pbProgress";
            //
            // lblStatus
            //
            this.lblStatus      = new ToolStripStatusLabel();
            this.lblStatus.Size = new Size(46, 17);
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Text = "Статус:";
            //
            // lblComment
            //
            this.lblComment      = new ToolStripStatusLabel();
            this.lblComment.Size = new Size(64, 17);
            this.lblComment.Name = "lblComment";
            this.lblComment.Text = "Ожидание";
            //
            // gbControl
            //
            this.gbControl = new GroupBox();
            this.gbControl.SuspendLayout();
            this.gbControl.Size     = new Size(918, 53);
            this.gbControl.Location = new Point(3, 482);
            this.gbControl.Controls.Add(this.btnSettings);
            this.gbControl.Controls.Add(this.btnRefresh);
            this.gbControl.Controls.Add(this.btnExecute);
            this.gbControl.TabIndex = 2;
            this.gbControl.TabStop  = false;
            this.gbControl.Name     = "gbControl";
            this.gbControl.Text     = "Действия";
            this.gbControl.ResumeLayout(false);
            this.gbControl.PerformLayout();
            //
            // gbType
            //
            this.gbType = new GroupBox();
            this.gbType.SuspendLayout();
            this.gbType.Controls.Add(this.lblError);
            this.gbType.Controls.Add(this.lblEnd);
            this.gbType.Controls.Add(this.lblNormal);
            this.gbType.Controls.Add(this.rbNormal);
            this.gbType.Controls.Add(this.rbEnd);
            this.gbType.Controls.Add(this.rbError);
            this.gbType.Size     = new Size(190, 110);
            this.gbType.Location = new Point(3, 12);
            this.gbType.TabStop  = false;
            this.gbType.TabIndex = 0;
            this.gbType.Name     = "gbType";
            this.gbType.Text     = "Режим";
            this.gbType.ResumeLayout(false);
            this.gbType.PerformLayout();
            //
            // gbSettings
            //
            this.gbSettings = new GroupBox();
            this.gbSettings.SuspendLayout();
            this.gbSettings.Size     = new Size(190, 105);
            this.gbSettings.Location = new Point(3, 127);
            this.gbSettings.Controls.Add(this.rbCount);
            this.gbSettings.Controls.Add(this.rbLists);
            this.gbSettings.Controls.Add(this.cbAutoExec);
            this.gbSettings.Controls.Add(this.numCount);
            this.gbSettings.Controls.Add(this.numLists);
            this.gbSettings.Controls.Add(this.numTimer);
            this.gbSettings.Controls.Add(this.lblCount);
            this.gbSettings.Controls.Add(this.lblLists);
            this.gbSettings.Controls.Add(this.lblInterval);
            this.gbSettings.TabStop  = false;
            this.gbSettings.TabIndex = 1;
            this.gbSettings.Name     = "gbSettings";
            this.gbSettings.Text     = "Настройки";
            this.gbSettings.ResumeLayout(false);
            this.gbSettings.PerformLayout();
            //
            // ssStatus
            //
            this.ssStatus = new StatusStrip();
            this.ssStatus.SuspendLayout();
            this.ssStatus.Size     = new Size(924, 22);
            this.ssStatus.Location = new Point(0, 538);
            this.ssStatus.Items.Add(this.lblProgress);
            this.ssStatus.Items.Add(this.lblProgress);
            this.ssStatus.Items.Add(this.lblStatus);
            this.ssStatus.Items.Add(this.lblComment);
            this.ssStatus.Items.Add(this.pbProgress);
            this.ssStatus.TabIndex = 8;
            this.ssStatus.Name     = "ssStatus";
            this.ssStatus.Text     = "ssStatus";
            this.ssStatus.ResumeLayout(false);
            this.ssStatus.PerformLayout();
            //
            // dgvLists
            //
            this.dgvLists = new DataGridView();
            this.dgvLists.AllowUserToAddRows    = false;
            this.dgvLists.AllowUserToDeleteRows = false;
            this.dgvLists.AllowUserToResizeRows = false;
            this.dgvLists.ColumnHeadersDefaultCellStyle.Font               = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204)));
            this.dgvLists.ColumnHeadersDefaultCellStyle.Alignment          = DataGridViewContentAlignment.MiddleCenter;
            this.dgvLists.ColumnHeadersDefaultCellStyle.BackColor          = SystemColors.Control;
            this.dgvLists.ColumnHeadersDefaultCellStyle.WrapMode           = DataGridViewTriState.True;
            this.dgvLists.ColumnHeadersDefaultCellStyle.ForeColor          = SystemColors.WindowText;
            this.dgvLists.ColumnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Highlight;
            this.dgvLists.ColumnHeadersDefaultCellStyle.SelectionForeColor = SystemColors.HighlightText;
            this.dgvLists.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvLists.Columns.Add(this.dgvCheck);
            this.dgvLists.Columns.Add(this.dgvLSTType);
            this.dgvLists.Columns.Add(this.dgvCNTNew);
            this.dgvLists.Columns.Add(this.dgvCNTPartial);
            this.dgvLists.Columns.Add(this.dgvCNTProcess);
            this.dgvLists.Columns.Add(this.dgvCNTTerminate);
            this.dgvLists.Columns.Add(this.dgvWRKNormal);
            this.dgvLists.Columns.Add(this.dgvWRKEnd);
            this.dgvLists.Columns.Add(this.dgvWRKError);
            this.dgvLists.EditMode          = DataGridViewEditMode.EditOnKeystroke;
            this.dgvLists.Size              = new Size(906, 213);
            this.dgvLists.Location          = new Point(6, 19);
            this.dgvLists.ShowRowErrors     = false;
            this.dgvLists.ShowCellErrors    = false;
            this.dgvLists.ShowEditingIcon   = false;
            this.dgvLists.ShowCellToolTips  = false;
            this.dgvLists.RowHeadersVisible = false;
            this.dgvLists.TabIndex          = 6;
            this.dgvLists.Name              = "dgvLists";
            this.dgvLists.CellContentClick += new DataGridViewCellEventHandler(this.dgvLists_CellContentClick);
            //
            // frmMain
            //
            this.frmMain            = new Form();
            this.frmMain.ClientSize = new Size(924, 560);
            this.frmMain.Controls.Add(this.gbControl);
            this.frmMain.Controls.Add(this.gbLists);
            this.frmMain.Controls.Add(this.gbType);
            this.frmMain.Controls.Add(this.gbLog);
            this.frmMain.Controls.Add(this.gbSettings);
            this.frmMain.Controls.Add(this.ssStatus);
            this.frmMain.MaximizeBox     = false;
            this.frmMain.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.frmMain.StartPosition   = FormStartPosition.CenterScreen;
            this.frmMain.Name            = "AutoRun";
            this.frmMain.Text            = "Автоматическая обработка реестров";
            this.frmMain.Load           += new EventHandler(this.AutoRun_Load);
            this.frmMain.Disposed       += new EventHandler(this.AutoRun_Disposed);
            this.frmMain.ResumeLayout(false);
            this.frmMain.PerformLayout();
            this.frmMain.SuspendLayout();

            return;
        }
예제 #19
0
        public void SetEditable(bool bEditable)
        {
            m_bIsEditable = bEditable;
            if (m_bIsEditable)
            {
                // 设定标题栏,默认有个隐藏列
                this.Header = new string[]
                {
                    CS_Delete, CS_StationID, CS_StationName, CS_TimeCollected, CS_WaterStage, CS_WaterFlow, CS_DataState, CS_TimeReceived, CS_ChannelType, CS_MsgType
                };

                // this.HideColomns = new int[] { 8 };

                //开启编辑模式,设置可编辑列

                DataGridViewCheckBoxColumn deleteCol = new DataGridViewCheckBoxColumn();
                base.SetColumnEditStyle(0, deleteCol);

                //// 设置采集时间编辑列
                //CalendarColumn collectionCol = new CalendarColumn();
                //base.SetColumnEditStyle(2, collectionCol);

                // 水位编辑列
                DataGridViewNumericUpDownColumn waterStage = new DataGridViewNumericUpDownColumn()
                {
                    Minimum       = 0,
                    Maximum       = 65537,
                    DecimalPlaces = 2 /*好像是设置小数点后面的位数*/
                };
                base.SetColumnEditStyle(4, waterStage);

                // 时段雨量编辑列
                DataGridViewNumericUpDownColumn waterFlow = new DataGridViewNumericUpDownColumn()
                {
                    Minimum       = 0,
                    Maximum       = 65537,
                    DecimalPlaces = 3 /*好像是设置小数点后面的位数*/
                };
                base.SetColumnEditStyle(5, waterFlow);

                // 数据状态,可编辑列
                DataGridViewComboBoxColumn dataStateCol = new DataGridViewComboBoxColumn();
                dataStateCol.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
                dataStateCol.Items.AddRange(new object[] { CS_DataState_Normal, CS_DataState_AbNormal });
                base.SetColumnEditStyle(6, dataStateCol);

                // 接收时间
                CalendarColumn recvTime = new CalendarColumn();
                base.SetColumnEditStyle(7, recvTime);

                // 通讯方式,不可编辑

                // 报文类型,不可编辑

                // 设置删除列的宽度
                this.Columns[0].Width = 40; //删除列宽度为20
                this.Columns[3].Width = 125;
                this.Columns[7].Width = 125;
            }
            else
            {
                this.Columns[2].Width = 125;
                this.Columns[5].Width = 125;
            }
        }
예제 #20
0
        protected override void tworzKolumny()
        {
            DateTime wybranyMiesiacRok = (DateTime)listaDat.Cb_miesiace.SelectedValue;
            //this.close
            int miesiac = wybranyMiesiacRok.Month;
            int rok     = -1;

            try
            {
                rok = wybranyMiesiacRok.Year;
                if (rok < 1000)
                {
                    throw new Exception();
                }
            }
            catch (Exception)
            {
                miesiac = -1;
            }

            //typDanych = ETypDanych.obecnosc;
            DataGridViewColumn newCol = new DataGridViewColumn();
            DataGridViewCell   cell   = new DataGridViewTextBoxCell();

            newCol.CellTemplate = cell;
            newCol.HeaderText   = "ID";
            newCol.Name         = "ID";
            newCol.Visible      = false;
            dgv.Columns.Add(newCol);

            newCol = new DataGridViewColumn();
            cell   = new DataGridViewTextBoxCell();
            newCol.CellTemplate = cell;
            newCol.HeaderText   = "nazwa przedmiotu";
            newCol.Name         = "nazwa_przedmiotu";
            newCol.Visible      = true;
            newCol.ReadOnly     = true;
            dgv.Columns.Add(newCol);
            if (miesiac <= 0)
            {
                for (int i = 0; i < listaDat.zbior.Count; i++)
                {
                    if (typDanych == ETypDanych.ocena)
                    {
                        newCol              = new DataGridViewColumn();
                        cell                = new DataGridViewTextBoxCell();
                        newCol.ReadOnly     = false;
                        newCol.CellTemplate = cell;
                    }
                    else
                    {
                        newCol = new DataGridViewCheckBoxColumn();
                        DataGridViewCheckBoxCell c = new DataGridViewCheckBoxCell();
                        newCol.CellTemplate = c;
                    }


                    newCol.HeaderText = listaDat.zbior[i].Dzien.ToShortDateString();
                    newCol.Name       = listaDat.zbior[i].Dzien.ToShortDateString();
                    newCol.Visible    = true;
                    dgv.Columns.Add(newCol);
                }
            }
            else
            {
                List <DateTime> ld = new List <DateTime>();
                foreach (data d in listaDat.zbior)
                {
                    ld.Add(d.Dzien);
                }
                List <DateTime> ldd = null;
                if (rok > 0)
                {
                    ldd = ld.Select(d => new DateTime(d.Year, d.Month, d.Day)).Where(d => d.Month == wybranyMiesiacRok.Month && d.Year == rok).ToList();
                }
                else
                {
                    ldd = ld.Select(d => new DateTime(d.Year, d.Month, d.Day)).Where(d => d.Month == wybranyMiesiacRok.Month).ToList();
                }
                foreach (DateTime d in ldd)
                {
                    if (typDanych == ETypDanych.ocena)
                    {
                        newCol              = new DataGridViewColumn();
                        cell                = new DataGridViewTextBoxCell();
                        newCol.ReadOnly     = false;
                        newCol.CellTemplate = cell;
                    }
                    else
                    {
                        newCol = new DataGridViewCheckBoxColumn();
                        DataGridViewCheckBoxCell c = new DataGridViewCheckBoxCell();
                        newCol.CellTemplate = c;
                    }
                    newCol.HeaderText = d.ToShortDateString();
                    newCol.Name       = d.ToShortDateString();
                    newCol.Visible    = true;
                    dgv.Columns.Add(newCol);
                }
            }


            newCol              = new DataGridViewColumn();
            cell                = new DataGridViewTextBoxCell();
            newCol.ReadOnly     = false;
            newCol.CellTemplate = cell;
            newCol.HeaderText   = newCol.Name = (typDanych == ETypDanych.ocena) ? "srednia" : "frekwencja";
            newCol.Visible      = true;
            newCol.ReadOnly     = true;
            newCol.DefaultCellStyle.BackColor = Color.Beige;
            dgv.Columns.Add(newCol);
        }
예제 #21
0
        private void GetCustomProperty()
        {
            try
            {
                dgvCustomProperty.Columns.Clear();
                //设置读取XML文件起点
                XmlNodeList xmlNodeListAttribute = xmlDocument.SelectNodes("/Properties/Attributes/Attribute");
                foreach (XmlNode node in xmlNodeListAttribute)
                {
                    DataGridViewColumn dataGridViewColumn;
                    switch (node.Attributes["ShowType"].Value)
                    {
                    case "TextBox":
                        dataGridViewColumn = new DataGridViewTextBoxColumn();
                        break;

                    case "CheckBox":
                        dataGridViewColumn           = new DataGridViewCheckBoxColumn();
                        dataGridViewColumn.ValueType = System.Type.GetType("System.Boolean");
                        break;

                    case "ComboBox":
                        dataGridViewColumn = new DataGridViewComboBoxColumn();
                        if (Convert.ToBoolean(node.Attributes["DataBind"].Value) == true)
                        {
                            XmlNodeList xmlNodeListDataDict = xmlDocumentDataDict.SelectNodes("/DataDicts/DataDict");
                            foreach (XmlNode nodeDataDict in xmlNodeListDataDict)
                            {
                                if (node.Attributes["DataSource"].Value == nodeDataDict.Attributes["Name"].Value)
                                {
                                    foreach (XmlNode nodeDataDictData in nodeDataDict.ChildNodes)
                                    {
                                        if ("Data" == nodeDataDictData.Name)
                                        {
                                            ((DataGridViewComboBoxColumn)dataGridViewColumn).Items.Add(nodeDataDictData.Attributes["Name"].Value);
                                        }
                                    }
                                }
                            }
                        }
                        break;

                    default:
                        dataGridViewColumn = new DataGridViewTextBoxColumn();
                        break;
                    }
                    dataGridViewColumn.Name       = node.Attributes["Name"].Value;
                    dataGridViewColumn.HeaderText = node.Attributes["Remark"].Value;
                    dgvCustomProperty.Columns.Add(dataGridViewColumn);
                }

                XmlNodeList xmlNodeListProperty = xmlDocument.SelectNodes("/Properties/Property");
                foreach (XmlNode node in xmlNodeListProperty)
                {
                    object[] obj = new object[node.Attributes.Count];
                    int      i   = 0;
                    foreach (XmlAttribute attribute in node.Attributes)
                    {
                        obj[i] = attribute.Value;
                        i++;
                    }
                    dgvCustomProperty.Rows.Add(obj);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #22
0
        private void frmWareHouseTransfers_Load(object sender, EventArgs e)
        {
            formloaded = false;
            Submit     = true;

            core = new Util();

            using (var context = new TTI2Entities())
            {
                QueryParms = new CustomerServicesParameters();

                cmboFrom.DataSource    = context.TLADM_Departments.Where(x => x.Dep_IsCMT).ToList();
                cmboFrom.ValueMember   = "Dep_Id";
                cmboFrom.DisplayMember = "Dep_Description";
                cmboFrom.SelectedValue = -1;

                cmboTo.DataSource    = context.TLADM_WhseStore.Where(x => x.WhStore_WhseOrStore).ToList();
                cmboTo.ValueMember   = "WhStore_Id";
                cmboTo.DisplayMember = "WhStore_Description";
                cmboTo.SelectedValue = -1;

                var Styles = context.TLADM_Styles.OrderBy(x => x.Sty_Description).ToList();
                foreach (var Style in Styles)
                {
                    cmboStyles.Items.Add(new CustomerServices.CheckComboBoxItem(Style.Sty_Id, Style.Sty_Description, false));
                }

                var Colours = context.TLADM_Colours.Where(x => !(bool)x.Col_Discontinued).OrderBy(x => x.Col_Display).ToList();
                foreach (var Colour in Colours)
                {
                    cmboColours.Items.Add(new CustomerServices.CheckComboBoxItem(Colour.Col_Id, Colour.Col_Display, false));
                }

                var Sizes = context.TLADM_Sizes.Where(x => !(bool)x.SI_Discontinued).OrderBy(x => x.SI_DisplayOrder).ToList();
                foreach (var Size in Sizes)
                {
                    cmboSizes.Items.Add(new CustomerServices.CheckComboBoxItem(Size.SI_id, Size.SI_Description, false));
                }


                DGVResults.Visible = false;

                oTxtA           = new DataGridViewTextBoxColumn();
                oTxtA.Visible   = false;
                oTxtA.ValueType = typeof(int);
                oTxtA.ReadOnly  = true;
                DGVResults.Columns.Add(oTxtA);

                oChkA            = new DataGridViewCheckBoxColumn();
                oChkA.Visible    = true;
                oChkA.ValueType  = typeof(Boolean);
                oChkA.HeaderText = "Select";
                DGVResults.Columns.Add(oChkA);

                oTxtB            = new DataGridViewTextBoxColumn();
                oTxtB.Visible    = true;
                oTxtB.HeaderText = "Box Detail";
                oTxtB.ReadOnly   = true;
                oTxtB.ValueType  = typeof(string);
                DGVResults.Columns.Add(oTxtB);

                oTxtC            = new DataGridViewTextBoxColumn();
                oTxtC.Visible    = true;
                oTxtC.HeaderText = "Box Qty";
                oTxtC.ReadOnly   = true;
                oTxtC.ValueType  = typeof(int);
                DGVResults.Columns.Add(oTxtC);

                oTxtD            = new DataGridViewTextBoxColumn();
                oTxtD.Visible    = true;
                oTxtD.HeaderText = "Box Weight";
                oTxtD.ReadOnly   = true;
                oTxtD.ValueType  = typeof(decimal);
                DGVResults.Columns.Add(oTxtD);

                oTxtE            = new DataGridViewTextBoxColumn();
                oTxtE.Visible    = true;
                oTxtE.HeaderText = "Customer";
                oTxtE.ReadOnly   = true;
                oTxtE.ValueType  = typeof(string);
                DGVResults.Columns.Add(oTxtE);

                oTxtF            = new DataGridViewTextBoxColumn();
                oTxtF.Visible    = true;
                oTxtF.HeaderText = "Style";
                oTxtF.ReadOnly   = true;
                oTxtF.ValueType  = typeof(string);
                DGVResults.Columns.Add(oTxtF);

                oTxtG            = new DataGridViewTextBoxColumn();
                oTxtG.Visible    = true;
                oTxtG.HeaderText = "Colour";
                oTxtG.ReadOnly   = true;
                oTxtG.ValueType  = typeof(string);
                DGVResults.Columns.Add(oTxtG);

                oTxtH            = new DataGridViewTextBoxColumn();
                oTxtH.Visible    = true;
                oTxtH.HeaderText = "Size";
                oTxtH.ReadOnly   = true;
                oTxtH.ValueType  = typeof(string);
                DGVResults.Columns.Add(oTxtH);

                DGVResults.AutoGenerateColumns = false;
                DGVResults.AllowUserToAddRows  = false;

                formloaded = true;
            }
        }
예제 #23
0
        private void PRM_PRF_002_Load(object sender, EventArgs e)                                         // 메인 그리드뷰
        {
            ((MainForm)this.MdiParent).MyUpdateEvent    += new System.EventHandler(this.MyUpdateShow);    //수정 이벤트 등록
            ((MainForm)this.MdiParent).RefreshFormEvent += new System.EventHandler(this.RefreshFormShow); // 새로고침

            dgvMainGrid.CellDoubleClick  += DgvMainGrid_CellDoubleClick;                                  //메인그리드뷰 더블클릭
            dgvSubGrid.CellDoubleClick   += DgvSubGrid_CellDoubleClick;                                   //서브그리드뷰 더블클릭
            dgvMainGrid.CellContentClick += dgvMainGrid_CellContentClick;                                 //체크박스
            dgvSubGrid.CellContentClick  += dgvSubGrid_CellContentClick;                                  //체크박스


            #region 메인 그리드뷰 체크박스
            DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
            chk.HeaderText = "";
            chk.Name       = "chk";
            chk.Width      = 30;
            dgvMainGrid.Columns.Add(chk);

            Point headerLocation = dgvMainGrid.GetCellDisplayRectangle(0, -1, true).Location;

            headerCheckBox.Location  = new Point(headerLocation.X + 8, headerLocation.Y + 2);
            headerCheckBox.BackColor = Color.White;
            headerCheckBox.Size      = new Size(18, 18);
            headerCheckBox.Click    += new EventHandler(headerCheckBox_Click);

            dgvMainGrid.Controls.Add(headerCheckBox);
            #endregion

            #region 서브 그리드뷰 체크박스
            DataGridViewCheckBoxColumn chkSub = new DataGridViewCheckBoxColumn();
            chkSub.HeaderText = "";
            chkSub.Name       = "Subchk";
            chkSub.Width      = 30;
            dgvSubGrid.Columns.Add(chkSub);

            Point headerLocationSub = dgvSubGrid.GetCellDisplayRectangle(0, -1, true).Location;

            headerCheckBox1.Location  = new Point(headerLocationSub.X + 8, headerLocationSub.Y + 2);
            headerCheckBox1.BackColor = Color.White;
            headerCheckBox1.Size      = new Size(18, 18);
            headerCheckBox1.Click    += new EventHandler(SubheaderCheckBox_Click);

            dgvSubGrid.Controls.Add(headerCheckBox1);
            #endregion

            #region 메인그리드뷰
            DatagridviewDesigns.SetDesign(dgvMainGrid);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "생산일자", "Prd_Date", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "작업지시상태", "Wo_Status", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "작업지시번호", "Workorderno", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "품목코드", "Item_Code", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "품목명", "Item_Name", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "작업장", "Wc_Name", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "투입수량", "In_Qty_Main", true, 100, DataGridViewContentAlignment.MiddleRight, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "산출수량", "Out_Qty_Main", true, 100, DataGridViewContentAlignment.MiddleRight, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvMainGrid, "생산수량", "Prd_Qty", true, 100, DataGridViewContentAlignment.MiddleRight, true);
            #endregion

            #region 서브그리드뷰
            DatagridviewDesigns.SetDesign(dgvSubGrid);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvSubGrid, "팔렛트번호", "Pallet_No", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvSubGrid, "등급", "Grade_Code", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvSubGrid, "등급상세 코드", "Grade_Detail_Code", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvSubGrid, "등급상세명", "Grade_Detail_Name", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvSubGrid, "수량", "In_Qty", true, 100, DataGridViewContentAlignment.MiddleRight, true);
            DatagridviewDesigns.AddNewColumnToDataGridView_Autosize(dgvSubGrid, "팔렛트 마감 여부", "Use_YN", true, 100, DataGridViewContentAlignment.MiddleCenter, true);
            #endregion

            DataLoad(); // 그리드뷰
        }
예제 #24
0
        //---------------------------------------------------------------------------
        // setupGridView
        //---------------------------------------------------------------------------
        static public void setupGridView(DataGridView gridView, string dataType, string detailType, string groupType)
        {
            gridView.AutoGenerateColumns = false;
            gridView.Columns.Clear();

            foreach (GridDefData dataDef in mGridDefData.mDatas)
            {
                if (dataDef.mType != dataType)
                {
                    continue;
                }
                if (dataDef.mDisableAdd)
                {
                    gridView.AllowUserToAddRows = false;
                }
                else
                {
                    gridView.AllowUserToAddRows = true;
                }
                foreach (GridDefGroup groupDef in dataDef.mGroups)
                {
                    if (groupDef.mGroupName != groupType)
                    {
                        continue;
                    }
                    List <GridDefColumn> columns = null;
                    if (detailType != "")
                    {
                        foreach (GridDefDetail detail in groupDef.mDetails)
                        {
                            if (detail.mDataName == detailType)
                            {
                                columns = detail.mColumns;
                                break;
                            }
                        }
                        if (columns == null)
                        {
                            break;
                        }
                    }
                    else
                    {
                        columns = groupDef.mColumns;
                    }
                    foreach (GridDefColumn colDef in columns)
                    {
                        DataGridViewColumn col = null;
                        if (colDef.mColumnType == "Text")
                        {
                            col = new DataGridViewTextBoxColumn();
                        }
                        else if (colDef.mColumnType == "Check")
                        {
                            col = new DataGridViewCheckBoxColumn();
                        }
                        else if (colDef.mColumnType == "Combo")
                        {
                            DataGridViewComboBoxColumn comboCol = new DataGridViewComboBoxColumn();
                            Object dataSource = getDataSource(colDef.mDataSource);
                            if (dataSource != null)
                            {
                                comboCol.DataSource    = dataSource;
                                comboCol.ValueMember   = colDef.mValueMember;
                                comboCol.DisplayMember = colDef.mDisplayMember;
                            }
                            else
                            {
                                foreach (string itemDef in colDef.mItems)
                                {
                                    comboCol.Items.Add(itemDef);
                                }
                            }
                            col = comboCol;
                        }
                        if (col != null)
                        {
                            col.DataPropertyName = colDef.mDataName;
                            if (colDef.mValueType == "int")
                            {
                                col.ValueType = typeof(int);
                            }
                            else if (colDef.mValueType == "string")
                            {
                                col.ValueType = typeof(string);
                            }
                            else if (colDef.mValueType == "bool")
                            {
                                col.ValueType = typeof(bool);
                            }
                            else if (colDef.mValueType == "float")
                            {
                                col.ValueType = typeof(float);
                            }
                            if (colDef.mHeaderText.Length > 0)
                            {
                                col.HeaderText = colDef.mHeaderText;
                            }
                            col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
                            col.ReadOnly     = colDef.mReadOnly;
                            col.Frozen       = colDef.mFrozen;
                            gridView.Columns.Add(col);
                        }
                    }
                    break;
                }
                break;
            }
        }
예제 #25
0
        private void Header()
        {
            dgv_TransferAccount.Rows.Clear();
            dgv_TransferAccount.Columns.Clear();

            DataGridViewTextBoxColumn  col;
            DataGridViewCheckBoxColumn check;

            check          = new DataGridViewCheckBoxColumn();
            check.Name     = "入金";
            check.Width    = 30;
            check.ReadOnly = false;
            check.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            check.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgv_TransferAccount.Columns.Add(check);


            col          = new DataGridViewTextBoxColumn();
            col.Name     = "契約ID";
            col.Width    = 50;
            col.ReadOnly = true;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgv_TransferAccount.Columns.Add(col);


            col          = new DataGridViewTextBoxColumn();
            col.Name     = "顧客名";
            col.Width    = 100;
            col.ReadOnly = true;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgv_TransferAccount.Columns.Add(col);

            col          = new DataGridViewTextBoxColumn();
            col.Name     = "口座名";
            col.Width    = 80;
            col.ReadOnly = true;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgv_TransferAccount.Columns.Add(col);

            col          = new DataGridViewTextBoxColumn();
            col.Name     = "口座番号";
            col.Width    = 80;
            col.ReadOnly = true;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgv_TransferAccount.Columns.Add(col);

            col          = new DataGridViewTextBoxColumn();
            col.Name     = "合計金額";
            col.Width    = 80;
            col.ReadOnly = true;
            col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgv_TransferAccount.Columns.Add(col);


            //col = new DataGridViewTextBoxColumn();
            //col.Name = "駐車場名";
            //col.Width = 100;
            //col.ReadOnly = true;
            //col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            //col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            //dgv_TransferAccount.Columns.Add(col);


            //col = new DataGridViewTextBoxColumn();
            //col.Name = "区画名";
            //col.Width = 100;
            //col.ReadOnly = true;
            //col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            //col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            //dgv_TransferAccount.Columns.Add(col);
        }
예제 #26
0
        /// <summary>
        /// <para>종류 : Form Load 메서드</para>
        /// <para>기능 : 각종 초기세팅</para>
        /// <para>로직 : 1. 좌상단 텍스트에 현재시간 할당</para>
        /// <para>       2. Login으로 부터 받은 employee객체를 활용하여 우상단 텍스트에 이름 및 권한 할당</para>
        /// <para>       3. 매장테이블에서 매장 및 관리자 컬럼을 가져오는 query를 통해 Crud.ReadToGrid를 활용하여 dataset을 얻고 좌측 테이블에 tempFuncForWinform.setDataGridView 메서드를 통해 할당</para>
        /// <para>       4. 테이블에 checkBoxColumn추가, readonly 설정, cellSelection제거, </para>
        /// <para>       5. dateTimePicker 현재시간으로 초기화</para>
        /// <para>       6. textBox 가운데 정렬 및 폰트 설정</para>
        /// <para>       7. 주소검색, 직원검색 버튼 비활성화</para>
        /// <para>       8. 라벨 및 dateTimePicker폰트 설정</para>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void StoreManage_Load(object sender, EventArgs e)
        {
            //1. 왼쪽 메뉴 버튼 동적 생성 후에 필요
            //List<string> menuList = getMenuList();
            //foreach (var m in menuList)
            //{
            //    makebutton(this, coord, dictButtonProperty);
            //}

            //2. Panel_Top_Left 현재시간 할당
            labelCurrentDate.Text = DateTime.Now.ToString("yyyy - MM - dd : tt hh : mm");

            //3. Panel_Top_Right 관리자 이름 할당
            if (employee.st_emp_level != 1)
            {
                labelAdminName.Text = employee.st_emp_member + " (관리자)";
            }
            else
            {
                labelAdminName.Text = employee.st_emp_member + " (비관리자)";
            }


            //4. Panel_Left_Second datatable 할당
            string  queryReadStore = sqlQuery.select_From_("st_table", new string[] { "st_name", "st_manager" });
            DataSet dataSetStore   = crud.ReadToGrid_MySql(queryReadStore);

            //컬럼이름 할당
            dataSetStore.Tables[0].Columns["st_name"].ColumnName    = "매장명";
            dataSetStore.Tables[0].Columns["st_manager"].ColumnName = "관리자";

            tempFuncForWinform.setDataGridView(dataSetStore, dataGridViewStore);
            //check박스 컬럼 추가
            DataGridViewCheckBoxColumn dgvCmb = new DataGridViewCheckBoxColumn();

            dgvCmb.ValueType = typeof(bool);
            dgvCmb.Name      = "";
            dataGridViewStore.Columns.Insert(0, dgvCmb);

            dataGridViewStore.ClearSelection();
            dataGridViewStore.Columns[0].Width    = 30;
            dataGridViewStore.ReadOnly            = false;
            dataGridViewStore.Columns[1].ReadOnly = true;
            dataGridViewStore.Columns[2].ReadOnly = true;


            // datepicker init
            dateTimePickerContractDate.Value       = DateTime.Now;
            dateTimePickerContractDate2.Value      = dateTimePickerContractDate.Value.AddYears(1);
            dateTimePickerManagementExpense.Value  = DateTime.Now;
            dateTimePickerElectricityExpense.Value = DateTime.Now;
            dateTimePickerWaterExpense.Value       = DateTime.Now;

            // 텍스트 가운데 정렬
            textBoxSetting();

            //로드시 readonly
            readonlyTextBoxAndDatetimePicker(true);
            //로드시 buttontogglle false
            buttonEnableToggle(false, buttonForCreateAndUpdateArray);
            //폰트설정
            labelSetting();
            //폰트설정
            dateTimePickerSetting();
        }
        /// <summary>
        /// 外部调用可控制宽度,嘿嘿
        /// </summary>
        /// <param name="bEnable"></param>
        public void SetEditMode(bool bEnable)
        {
            if (bEnable)
            {
                // 设定标题栏,默认有个隐藏列
                this.Header = new string[]
                {
                    CS_StationId, CS_BGTM, CS_PTNO, CS_ZR, CS_Q1, CS_Q2, CS_Q3, CS_Q4, CS_Q5, CS_Q6, CS_currQ
                };
                //this.HideColomns = new int[]
                //{
                //    12 /*CS_RecordId*/
                //};

                //开启编辑模式,设置可编辑列
                DataGridViewCheckBoxColumn deleteCol = new DataGridViewCheckBoxColumn();
                base.SetColumnEditStyle(0, deleteCol);

                ////// 设置站号编辑列
                //DataGridViewNumericUpDownColumn stationIdCol = new DataGridViewNumericUpDownColumn();
                //// stationId.Maximum = Decimal.MaxValue;
                //base.SetColumnEditStyle(1, stationIdCol);


                ////// 设置站号编辑列
                //DataGridViewNumericUpDownColumn PTNOCol = new DataGridViewNumericUpDownColumn();
                //// stationId.Maximum = Decimal.MaxValue;
                //base.SetColumnEditStyle(3, PTNOCol);

                // 设置水位编辑列
                DataGridViewNumericUpDownColumn waterCol = new DataGridViewNumericUpDownColumn();
                waterCol.Maximum       = Decimal.MaxValue;
                waterCol.Minimum       = Decimal.MinValue;
                waterCol.DecimalPlaces = 2;
                base.SetColumnEditStyle(4, waterCol);

                //// 设置流量1编辑列
                DataGridViewNumericUpDownColumn Q1Col = new DataGridViewNumericUpDownColumn();
                Q1Col.Maximum       = Decimal.MaxValue;
                Q1Col.Minimum       = Decimal.MinValue;
                Q1Col.DecimalPlaces = 3;
                base.SetColumnEditStyle(5, Q1Col);

                //// 设置流量2编辑列
                DataGridViewNumericUpDownColumn Q2Col = new DataGridViewNumericUpDownColumn();
                Q2Col.Maximum       = Decimal.MaxValue;
                Q2Col.Minimum       = Decimal.MinValue;
                Q2Col.DecimalPlaces = 3;
                base.SetColumnEditStyle(6, Q2Col);

                //// 设置流量3编辑列
                DataGridViewNumericUpDownColumn Q3Col = new DataGridViewNumericUpDownColumn();
                Q3Col.Maximum       = Decimal.MaxValue;
                Q3Col.Minimum       = Decimal.MinValue;
                Q3Col.DecimalPlaces = 3;
                base.SetColumnEditStyle(7, Q3Col);

                //// 设置流量4编辑列
                DataGridViewNumericUpDownColumn Q4Col = new DataGridViewNumericUpDownColumn();
                Q4Col.Maximum       = Decimal.MaxValue;
                Q4Col.Minimum       = Decimal.MinValue;
                Q4Col.DecimalPlaces = 3;
                base.SetColumnEditStyle(8, Q4Col);

                //// 设置流量5编辑列
                DataGridViewNumericUpDownColumn Q5Col = new DataGridViewNumericUpDownColumn();
                Q5Col.Maximum       = Decimal.MaxValue;
                Q5Col.Minimum       = Decimal.MinValue;
                Q5Col.DecimalPlaces = 3;
                base.SetColumnEditStyle(9, Q5Col);

                //// 设置流量6编辑列
                DataGridViewNumericUpDownColumn Q6Col = new DataGridViewNumericUpDownColumn();
                Q6Col.Maximum       = Decimal.MaxValue;
                Q6Col.Minimum       = Decimal.MinValue;
                Q6Col.DecimalPlaces = 3;
                base.SetColumnEditStyle(10, Q6Col);


                var cmb_currQ = new DataGridViewComboBoxColumn();
                cmb_currQ.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;

                cmb_currQ.Items.Add("1");
                cmb_currQ.Items.Add("2");
                cmb_currQ.Items.Add("3");
                cmb_currQ.Items.Add("4");
                cmb_currQ.Items.Add("5");
                cmb_currQ.Items.Add("6");
                base.SetColumnEditStyle(11, cmb_currQ);

                // 设置删除列的宽度
                this.Columns[0].Width  = 15; //删除列宽度为20
                this.Columns[2].Width  = 25; //删除列宽度为25
                this.Columns[11].Width = 25; //删除列宽度为25
            }
            else
            {
                // 只读模式未编写
                // 设定标题栏,默认有个隐藏列
                this.Header = new string[]
                {
                    CS_StationId, CS_BGTM, CS_PTNO, CS_ZR, CS_Q1, CS_Q2, CS_Q3, CS_Q4, CS_Q5, CS_Q6, CS_currQ
                };
                //this.Columns[0].Width = 25; //删除列宽度为25
                //this.Columns[1].Width = 120; //删除列宽度为25
                //this.Columns[2].Width = 15; //删除列宽度为25
                //this.Columns[3].Width = 15; //删除列宽度为25
                //this.Columns[4].Width = 40; //删除列宽度为25
                //this.Columns[5].Width = 40; //删除列宽度为25
                //this.Columns[6].Width = 40; //删除列宽度为25
                //this.Columns[7].Width = 40; //删除列宽度为25
                //this.Columns[8].Width = 40; //删除列宽度为25
                //this.Columns[9].Width = 40; //删除列宽度为25
                //this.Columns[10].Width = 25; //删除列宽度为25
                AutoSizeColumn(this);
                this.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                //this.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }
        }
예제 #28
0
        public void LoadEditProdList()
        {
            int i;

            //getting first already included products in a transaction
            if (rent != null)
            {
                rent.GetProducts();

                //productsSelected = new int[rent.DTable.Rows.Count];

                DataRow rRow;
                for (i = 0; i < rent.DTable.Rows.Count; i++)
                {
                    rRow = rent.DTable.Rows[i];
                    productsSelected[i] = Int32.Parse(rRow["ID"].ToString());
                }
            }

            if (sales != null)
            {
                sales.GetProducts();

                //productsSelected = new int[sales.DTable.Rows.Count];

                DataRow sRow;
                for (i = 0; i < sales.DTable.Rows.Count; i++)
                {
                    sRow = sales.DTable.Rows[i];
                    productsSelected[i] = Int32.Parse(sRow["ID"].ToString());
                }
            }

            SelectList slist = new SelectList();

            slist.GetAllProductsAvailable();
            dtSelProdList.DataSource = slist.DTable;

            //inserting checkbox control
            DataGridViewCheckBoxColumn chkbox = new DataGridViewCheckBoxColumn()
            {
                Name       = "Check",
                FalseValue = 0,
                TrueValue  = 1,
                Visible    = true
            };

            dtSelProdList.Columns.Insert(0, chkbox);


            //initializing checkboxes be checked
            foreach (DataGridViewRow row in dtSelProdList.Rows)
            {
                DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[0];
                if (row.Cells["ID"].Value != null)
                {
                    for (i = 0; i < productsSelected.Length; i++)
                    {
                        if (Int32.Parse(row.Cells[1].Value.ToString()) == productsSelected[i])
                        {
                            chk.Value = chk.TrueValue;
                            break;
                        }
                        else
                        {
                            chk.Value = chk.FalseValue;
                        }
                    }
                }
            }
        }
예제 #29
0
            /// <summary>
            /// データグリッドビューの定義を行います
            /// </summary>
            /// <param name="tempDGV">データグリッドビューオブジェクト</param>
            public static void Setting(DataGridView tempDGV)
            {
                try
                {
                    //フォームサイズ定義

                    // 列スタイルを変更する

                    tempDGV.EnableHeadersVisualStyles = false;
                    tempDGV.ColumnHeadersDefaultCellStyle.BackColor = Color.SteelBlue;
                    tempDGV.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

                    // 列ヘッダー表示位置指定
                    tempDGV.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;

                    // 列ヘッダーフォント指定
                    tempDGV.ColumnHeadersDefaultCellStyle.Font = new Font("Meiryo UI", 9, FontStyle.Regular);

                    // データフォント指定
                    tempDGV.DefaultCellStyle.Font = new Font("Meiryo UI", (float)9, FontStyle.Regular);

                    // 行の高さ
                    tempDGV.ColumnHeadersHeight = 18;
                    tempDGV.RowTemplate.Height  = 18;

                    // 全体の高さ
                    tempDGV.Height = 470;

                    // 奇数行の色
                    tempDGV.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender;

                    // 各列幅指定
                    tempDGV.Columns.Add("col1", "番号");
                    tempDGV.Columns.Add("col2", "クライアント名");
                    tempDGV.Columns.Add("col13", "フリガナ");
                    tempDGV.Columns.Add("col3", "担当者");
                    tempDGV.Columns.Add("col4", "発行日");
                    tempDGV.Columns.Add("col5", "請求金額");
                    tempDGV.Columns.Add("col6", "入金予定日");
                    tempDGV.Columns.Add("col7", "入金日");
                    tempDGV.Columns.Add("col8", "入金額");
                    tempDGV.Columns.Add("col9", "入金残高");

                    DataGridViewCheckBoxColumn cbc = new DataGridViewCheckBoxColumn();
                    tempDGV.Columns.Add(cbc);
                    tempDGV.Columns[10].HeaderText = "入金済";
                    tempDGV.Columns[10].Name       = "col10";

                    tempDGV.Columns.Add("col11", "請求書ID");
                    tempDGV.Columns.Add("col12", "備考");   // 2015/07/22

                    //tempDGV.Columns[1].Frozen = true;   // 2015/07/22

                    tempDGV.Columns[0].Width  = 60;
                    tempDGV.Columns[1].Width  = 220;
                    tempDGV.Columns[2].Width  = 160;
                    tempDGV.Columns[3].Width  = 100;
                    tempDGV.Columns[4].Width  = 100;
                    tempDGV.Columns[5].Width  = 100;
                    tempDGV.Columns[6].Width  = 100;
                    tempDGV.Columns[7].Width  = 100;
                    tempDGV.Columns[8].Width  = 100;
                    tempDGV.Columns[9].Width  = 100;
                    tempDGV.Columns[10].Width = 60;
                    tempDGV.Columns[12].Width = 200;

                    tempDGV.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                    tempDGV.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                    tempDGV.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                    tempDGV.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                    tempDGV.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                    tempDGV.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                    tempDGV.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                    tempDGV.Columns[9].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

                    //tempDGV.Columns[3].DefaultCellStyle.Format = "yyyy/M/dd";
                    //tempDGV.Columns[4].DefaultCellStyle.Format = "#,##0";
                    //tempDGV.Columns[5].DefaultCellStyle.Format = "yyyy/M/dd";
                    //tempDGV.Columns[7].DefaultCellStyle.Format = "#,##0";
                    //tempDGV.Columns[8].DefaultCellStyle.Format = "#,##0";

                    //請求書IDを非表示とする
                    tempDGV.Columns[11].Visible = false;

                    // 行ヘッダを表示しない
                    tempDGV.RowHeadersVisible = false;

                    // 選択モード
                    tempDGV.SelectionMode = DataGridViewSelectionMode.CellSelect;
                    tempDGV.MultiSelect   = false;

                    // 編集不可とする
                    tempDGV.ReadOnly = false;

                    // 編集可・不可の指定
                    foreach (DataGridViewColumn d in tempDGV.Columns)
                    {
                        if (d.Name == "col10" || d.Name == "col12")
                        {
                            d.ReadOnly = false;
                        }
                        else
                        {
                            d.ReadOnly = true;
                        }
                    }

                    // 追加行表示しない
                    tempDGV.AllowUserToAddRows = false;

                    // データグリッドビューから行削除を禁止する
                    tempDGV.AllowUserToDeleteRows = false;

                    // 手動による列移動の禁止
                    tempDGV.AllowUserToOrderColumns = false;

                    // 列サイズ変更禁止
                    tempDGV.AllowUserToResizeColumns = false;

                    // 行サイズ変更禁止
                    tempDGV.AllowUserToResizeRows = false;

                    // 行ヘッダーの自動調節
                    //tempDGV.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;

                    // 罫線
                    tempDGV.BorderStyle = BorderStyle.Fixed3D;
                    tempDGV.AdvancedColumnHeadersBorderStyle.All = DataGridViewAdvancedCellBorderStyle.None;
                    tempDGV.CellBorderStyle = DataGridViewCellBorderStyle.None;
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "エラーメッセージ", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
예제 #30
0
        public void refreshGamesDataSet()
        {
            //dataGridGames.AutoGenerateColumns = false;
            dataGridGames.Columns.Clear();
            dataGridGames.AutoGenerateColumns = false;

            //Hook up the db.dsGames dataset to the table
            db.refreshGameDataset(platform_id);
            dataGridGames.DataSource = db.dsGames.Tables[0];

            DataSet gameGenreDataSet            = db.getDataSet("select genre_name, id from genres order by genre_name");
            DataGridViewComboBoxColumn colGenre = new DataGridViewComboBoxColumn();

            colGenre.HeaderText = "Genre";
            colGenre.DataSource = gameGenreDataSet.Tables[0].DefaultView;
            colGenre.FlatStyle  = FlatStyle.Flat;

            colGenre.DataPropertyName = "genre_id";
            colGenre.DisplayMember    = "genre_name";
            colGenre.ValueMember      = "id";

            DataGridViewCheckBoxColumn colActive = new DataGridViewCheckBoxColumn();

            colActive.HeaderText       = "Active";
            colActive.Name             = "active";
            colActive.DataPropertyName = "active";
            colActive.SortMode         = DataGridViewColumnSortMode.Automatic;
            dataGridGames.Columns.Add(colActive);

            DataGridViewCheckBoxColumn colFav = new DataGridViewCheckBoxColumn();

            colFav.HeaderText       = "Favourite";
            colFav.Name             = "favourite";
            colFav.DataPropertyName = "favourite";
            colFav.SortMode         = DataGridViewColumnSortMode.Automatic;
            dataGridGames.Columns.Add(colFav);


            dataGridGames.Columns.Add("name", "Name");
            dataGridGames.Columns["name"].DataPropertyName = "name";

            dataGridGames.Columns.Add("file_name", "File Name");
            dataGridGames.Columns["file_name"].DataPropertyName = "file_name";

            dataGridGames.Columns.Add("gamedb_id", "GamesDB ID");
            dataGridGames.Columns["gamedb_id"].DataPropertyName = "gamedb_id";

            dataGridGames.Columns.Add("description", "Description");
            dataGridGames.Columns["description"].DataPropertyName = "description";

            dataGridGames.Columns.Add("release_year", "Release Year");
            dataGridGames.Columns["release_year"].DataPropertyName = "release_year";

            dataGridGames.Columns.Add("rating", "Rating");
            dataGridGames.Columns["rating"].DataPropertyName = "rating";

            dataGridGames.Columns.Add("players", "Players");
            dataGridGames.Columns["players"].DataPropertyName = "players";

            DataGridViewCheckBoxColumn colCo_op = new DataGridViewCheckBoxColumn();

            colCo_op.HeaderText       = "Co-op";
            colCo_op.Name             = "co_op";
            colCo_op.DataPropertyName = "co_op";
            colCo_op.SortMode         = DataGridViewColumnSortMode.Automatic;
            dataGridGames.Columns.Add(colCo_op);

            dataGridGames.Columns.Add("publisher", "Publisher");
            dataGridGames.Columns["publisher"].DataPropertyName = "publisher";

            dataGridGames.Columns.Add("developer", "Developer");
            dataGridGames.Columns["developer"].DataPropertyName = "developer";

            dataGridGames.Columns.Add("gamedb_stars", "GamesDB Stars");
            dataGridGames.Columns["gamedb_stars"].DataPropertyName = "gamedb_stars";

            dataGridGames.Columns.Add(colGenre);
        }
 ///<summary>
 /// Constructs the <see cref="DataGridViewCheckBoxColumnVWG"/> which is a wrapper around the <see cref="DataGridViewCheckBoxColumn"/>
 ///</summary>
 ///<param name="dataGridViewColumn"></param>
 public DataGridViewCheckBoxColumnVWG(DataGridViewCheckBoxColumn dataGridViewColumn) : base(dataGridViewColumn)
 {
     _dataGridViewCheckBoxColumn = dataGridViewColumn;
 }
예제 #32
0
        public frmCutView()
        {
            InitializeComponent();
            oTxtBoxA           = new DataGridViewTextBoxColumn();
            oTxtBoxA.ValueType = typeof(int);
            oTxtBoxA.Visible   = false;

            oTxtBoxB            = new DataGridViewTextBoxColumn();
            oTxtBoxB.HeaderText = "CutSheet Number";
            oTxtBoxB.ValueType  = typeof(string);

            oTxtBoxC            = new DataGridViewTextBoxColumn();
            oTxtBoxC.HeaderText = "DyeBatch Number";
            oTxtBoxC.ValueType  = typeof(string);

            oTxtBoxD            = new DataGridViewTextBoxColumn();
            oTxtBoxD.HeaderText = "DyeBatch Number";
            oTxtBoxD.ValueType  = typeof(DateTime);

            oTxtBoxE            = new DataGridViewTextBoxColumn();
            oTxtBoxE.HeaderText = "Quality";
            oTxtBoxE.ValueType  = typeof(string);

            oTxtBoxF            = new DataGridViewTextBoxColumn();
            oTxtBoxF.HeaderText = "Colour";
            oTxtBoxF.ValueType  = typeof(string);

            oTxtBoxG            = new DataGridViewTextBoxColumn();
            oTxtBoxG.HeaderText = "Size";
            oTxtBoxG.ValueType  = typeof(string);

            oTxtBoxH            = new DataGridViewTextBoxColumn();
            oTxtBoxH.HeaderText = "Style";
            oTxtBoxH.ValueType  = typeof(string);

            oTxtBoxJ            = new DataGridViewTextBoxColumn();
            oTxtBoxJ.HeaderText = "Customer";
            oTxtBoxJ.ValueType  = typeof(string);

            oChkA            = new DataGridViewCheckBoxColumn();
            oChkA.HeaderText = "Select";
            oChkA.ValueType  = typeof(bool);

            oChkB            = new DataGridViewCheckBoxColumn();
            oChkB.HeaderText = "Split";
            oChkB.ValueType  = typeof(bool);

            dataGridView1.Columns.Add(oTxtBoxA);
            dataGridView1.Columns.Add(oChkA);
            dataGridView1.Columns.Add(oChkB);
            dataGridView1.Columns.Add(oTxtBoxB);
            dataGridView1.Columns.Add(oTxtBoxC);
            dataGridView1.Columns.Add(oTxtBoxD);
            dataGridView1.Columns.Add(oTxtBoxE);
            dataGridView1.Columns.Add(oTxtBoxF);
            dataGridView1.Columns.Add(oTxtBoxG);
            dataGridView1.Columns.Add(oTxtBoxH);
            dataGridView1.Columns.Add(oTxtBoxJ);

            dataGridView1.AutoGenerateColumns     = false;
            dataGridView1.AllowUserToAddRows      = false;
            dataGridView1.AllowUserToOrderColumns = false;
        }