Example #1
0
        private void FCUSC_Edit_Click(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count == 0)
            {
                MessageBox.Show("没有要编辑的数据!");
            }
            else
            {
                if (dataGridView1.SelectedRows.Count == 0)
                {
                    MessageBox.Show("请选择要编辑的数据!");
                }
                else
                {
                    //设置只能打开一个,配合FrmCommonlyUsedSQLConfig中的GetFrmCommonlyUsedSQLConfig()设置
                    FrmCommonlyUsedSQLConfigNewEdit.GetFrmCommonlyUsedSQLConfigNewEdit().Activate();

                    FrmCommonlyUsedSQLConfigNewEdit fcuscne = new FrmCommonlyUsedSQLConfigNewEdit();
                    fcuscne.Text  = "编辑常用SQL";
                    fcuscne.type  = 1;//(type 0:新增,1:编辑)
                    fcuscne.code  = dataGridView1.SelectedCells[0].Value.ToString();
                    fcuscne.name  = dataGridView1.SelectedCells[1].Value.ToString();
                    fcuscne.value = dataGridView1.SelectedCells[2].Value.ToString();
                    //fqic.Show();

                    //接收FrmQuickInsertConfig返回的DialogResult,刷新右侧常用按钮功能Text
                    if (fcuscne.ShowDialog() == DialogResult.OK)
                    {
                        RefreshDG();
                    }
                }
            }
        }
Example #2
0
        private void FCUSC_New_Click(object sender, EventArgs e)
        {
            //设置只能打开一个,配合FrmCommonlyUsedSQLConfig中的GetFrmCommonlyUsedSQLConfig()设置
            FrmCommonlyUsedSQLConfigNewEdit.GetFrmCommonlyUsedSQLConfigNewEdit().Activate();

            FrmCommonlyUsedSQLConfigNewEdit fcuscne = new FrmCommonlyUsedSQLConfigNewEdit();

            fcuscne.Text = "新增常用SQL";
            fcuscne.type = 0;//(type 0:新增,1:编辑)
            //fqic.Show();

            //接收FrmQuickInsertConfig返回的DialogResult,刷新右侧常用按钮功能Text
            if (fcuscne.ShowDialog() == DialogResult.OK)
            {
                RefreshDG();
            }
        }