示例#1
0
        /// <summary>
        /// 切割方案快捷键
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridListCut_KeyDown(object sender, KeyEventArgs e)
        {
            this.gridListCut.EndEdit();
            try
            {
                if (e.Modifiers == Keys.Control)
                {
                    switch (e.KeyCode)
                    {
                    case Keys.X:
                        Cut();
                        break;

                    case Keys.C:
                        GridOilDataEdit.CopyToClipboard(this.gridListCut);
                        break;

                    case Keys.V:
                        Paste();
                        break;
                    }
                }
                if (e.KeyCode == Keys.Delete)
                {
                    Delete();
                }
            }
            catch (Exception ex)
            {
                Log.Error("原油应用切割方案快捷键" + ex);
            }
        }
        /// <summary>
        /// 数据编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.Modifiers == Keys.Control)
                {
                    switch (e.KeyCode)
                    {
                    case Keys.X:
                        Cut();
                        break;

                    case Keys.C:
                        GridOilDataEdit.CopyToClipboard(this.dataGridView1);
                        break;

                    case Keys.V:
                        Paste();
                        break;
                    }
                }
                if (e.KeyCode == Keys.Delete)
                {
                    Delete();
                }
            }
            catch (Exception ex)
            {
                Log.Error("经验审查中的范围审查配置表编辑操作" + ex);
            }
        }
示例#3
0
        private void CurveDataDgv_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Modifiers == Keys.Control)
            {
                switch (e.KeyCode)
                {
                case Keys.X:
                    GridOilDataEdit.CopyToClipboard(this.CurveDataDgv);
                    GridOilDataEdit.DeleteValues(this.CurveDataDgv);
                    break;

                case Keys.C:
                    GridOilDataEdit.CopyToClipboard(this.CurveDataDgv);
                    break;

                case Keys.V:
                    GridOilDataEdit.PasteClipboardValueLimit(this.CurveDataDgv);
                    break;

                case Keys.Z:    //撤销数据

                    break;

                case Keys.Y:    //重做

                    break;
                }
            }
            if (e.KeyCode == Keys.Delete)
            {
                GridOilDataEdit.DeleteValues(this.CurveDataDgv);
            }
        }
 /// <summary>
 /// 删除
 /// </summary>
 private void Delete()
 {
     GridOilDataEdit.DeleteValues(this.dataGridView1);
     //判断哪一行数据修改
     foreach (DataGridViewCell dgvCell in dataGridView1.SelectedCells)
     {
         int rowIndex = dgvCell.RowIndex;
         this.dataGridView1.Rows[rowIndex].Cells["IsModify"].Value = 1;
     }
 }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="oilInfoBEntity"></param>
        public FrmOilDataC(int OilInfoID)
        {
            InitializeComponent();

            this._oilInfoID = OilInfoID;
            this.tabControl1.SelectedTab = this.tabPage1;
            this._selectGridView         = this.dataGridView1;
            oilEdit = new GridOilDataEdit(this._oilInfoID);
            initDataGridView();
            waitingPanel = new WaitingPanel(this);
        }
 /// <summary>
 /// 剪贴
 /// </summary>
 private void Cut()
 {
     GridOilDataEdit.CopyToClipboard(this.dataGridView1);
     //从输入列表和数据库中删除数据
     GridOilDataEdit.DeleteValues(this.dataGridView1);
     //判断哪一行数据修改
     foreach (DataGridViewCell dgvCell in dataGridView1.SelectedCells)
     {
         int rowIndex = dgvCell.RowIndex;
         this.dataGridView1.Rows[rowIndex].Cells["IsModify"].Value = 1;
     }
 }
        GridOilDataEdit oilEdit  = null;                                               //用于编辑数据
        #endregion

        #region "构造函数"
        /// <summary>
        /// 构造函数
        /// </summary>
        public FrmExperienceRangeCheck()
        {
            InitializeComponent();
            InitStyle(); //设置表格显示样式
            SetHeader(); //设置表格的头部
            BindToolStripCmbTableType();
            this._trendTableType = (enumCheckRangeType)this.toolStripComboBox1.ComboBox.SelectedValue;

            BindDgdViewAll();
            oilEdit = new GridOilDataEdit();
            //initButton();
            //initTableHead();
        }
示例#8
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="oilInfoBEntity"></param>
 public ShowCutData(OilInfoBEntity oilInfoB, IList <CutMothedEntity> cutMotheds)
 {
     InitializeComponent();
     this._oilInfoB = oilInfoB;
     this.tabControl1.SelectedTab = this.tabPage1;
     this._cutMotheds             = cutMotheds;
     breakCutMotheds(cutMotheds);
     this._selectGridView = this.dataGridView1;
     oilEdit = new GridOilDataEdit(this._oilInfoB);
     initDataGridView();
     this.tabControl1.TabPages.Remove(this.tabPage2);
     this.dataGridView1.ReadOnly = true;
     this.dataGridView2.ReadOnly = true;
     this.dataGridView3.ReadOnly = true;
     this.dataGridView4.ReadOnly = true;
 }
        /// <summary>
        /// 粘帖
        /// </summary>
        private void Paste()
        {
            GridOilDataEdit.PasteClipboardValue(this.dataGridView1);

            //Get the satring Cell
            DataGridViewCell startCell = GridOilDataEdit.GetStartCell(this.dataGridView1);
            //Get the clipboard value in a dictionary
            Dictionary <int, Dictionary <int, string> > cbValue = GridOilDataEdit.ClipBoardValues(Clipboard.GetText());

            int iRowIndex = startCell.RowIndex;

            foreach (int rowKey in cbValue.Keys)//判断哪一行数据修改
            {
                this.dataGridView1.Rows[iRowIndex].Cells["IsModify"].Value = 1;
                iRowIndex++;
            }
        }
示例#10
0
 /// <summary>
 /// 剪贴
 /// </summary>
 private void Cut()
 {
     GridOilDataEdit.CopyToClipboard(this.gridListCut);
     //从输入列表和数据库中删除数据
     GridOilDataEdit.DeleteValues(this.gridListCut);
 }
示例#11
0
 private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GridOilDataEdit.DeleteValues(this.CurveDataDgv);
 }
示例#12
0
 private void 粘贴ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GridOilDataEdit.PasteClipboardValueLimit(this.CurveDataDgv);
 }
示例#13
0
 private void  制ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GridOilDataEdit.CopyToClipboard(this.CurveDataDgv);
 }
示例#14
0
 private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GridOilDataEdit.DeleteValues(this.dataGridView1);
 }
示例#15
0
 private void 粘贴ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GridOilDataEdit.PasteClipboardValue(this.dataGridView1);
 }
示例#16
0
 /// <summary>
 /// 粘帖
 /// </summary>
 private void Paste()
 {
     GridOilDataEdit.PasteClipboardValue(this.gridListCut);
 }
示例#17
0
 /// <summary>
 /// 删除
 /// </summary>
 private void Delete()
 {
     GridOilDataEdit.DeleteValues(this.gridListCut);
 }