예제 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var selects = dgvFieldSet.SelectedRows;

            if (selects.Count > 0 && (!selects[0].IsNewRow))
            {
                var name = selects[0].Cells["hideDataSet"].Value.ToString();

                AddForm childrenForm = new AddForm(_fieldSetsXml, _xmlPath, name);
                //childrenForm.MdiParent = this;
                childrenForm.AddEvent += new AddDelegateHander(OnAdd);//注册事件
                childrenForm.Show();
                //childrenForm.WindowState = FormWindowState.Maximized;//最大化
            }
        }
예제 #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            var selects = dgvFieldSet.SelectedRows;

            if (selects.Count > 0 && (!selects[0].IsNewRow))
            {
                var dataSet   = (selects[0].Cells["hideDataSet"].Value ?? "").ToString();
                var fieldName = (selects[0].Cells["FieldName"].Value ?? "").ToString();
                if ((!string.IsNullOrWhiteSpace(dataSet)) && (!string.IsNullOrWhiteSpace(fieldName)))
                {
                    AddForm childrenForm = new AddForm(_fieldSetsXml, _xmlPath, dataSet, fieldName);
                    childrenForm.EditEvent += new EditDelegateHander(OnEdit);//注册事件
                    childrenForm.Show();
                }
            }
        }