Ejemplo n.º 1
0
        private void GridCellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            checked
            {
                if (columnIndex == 5 && e.RowIndex != -1 && !this.grid1.Rows[e.RowIndex].IsNewRow)
                {
                    string aFN    = "10";
                    string fN     = "0009";
                    string sValue = Convert.ToString(this.grid1.Rows[rowIndex].Cells[columnIndex].Value);
                    string format = Convert.ToString(this.grid1.Rows[rowIndex].Cells[columnIndex - 1].Value);
                    MainForm.gMainForm.gDataParse.Activate();
                    MainForm.gMainForm.gDataParse.IsCustomize    = false;
                    MainForm.gMainForm.gDataParse.CustomizeItems = "";
                    MainForm.gMainForm.gDataParse.SetText645(sValue, aFN, fN, format);
                }
                if (columnIndex == 3 && e.RowIndex != -1 && !this.grid1.Rows[e.RowIndex].IsNewRow)
                {
                    iForm iForm = new DLT645Prot();
                    iForm.Data = "00000000?XXXXXX.XX";
                    iForm.SetText();
                    iForm.NeedSave = true;
                    iForm.ShowDialog();
                    if (!string.IsNullOrEmpty(iForm.Data))
                    {
                        if (!string.IsNullOrEmpty(iForm.Data.Split(new char[]
                        {
                            '?'
                        })[0]))
                        {
                            this.grid1.Rows[rowIndex].Cells[columnIndex].Value = iForm.Data.Split(new char[]
                            {
                                '?'
                            })[0];
                            this.grid1.Rows[rowIndex].Cells[columnIndex + 1].Value = iForm.Data.Split(new char[]
                            {
                                '?'
                            })[1];
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void ToolStripButton4Click(object sender, EventArgs e)
        {
            iForm iForm = new DLT645Prot();

            iForm.Data = "00000000";
            iForm.SetText();
            iForm.NeedSave = true;
            iForm.ShowDialog();
            this.toolStripTextBox2.Text = iForm.Data.Split(new char[]
            {
                '?'
            })[0];
            this.toolStripLabel3.Text = iForm.Data.Split(new char[]
            {
                '?'
            })[1];
            this.toolStripLabel5.Text = iForm.Data.Split(new char[]
            {
                '?'
            })[2];
        }