コード例 #1
0
        //private void toolStripButtonSelect_Click(object sender, EventArgs e)
        //{
        //    this.pagerWidget.ClearCondition();
        //    if (this.toolStripComboBoxSelect.SelectedIndex != 0)
        //    {
        //        this.pagerWidget.AddCondition(this.toolStripComboBoxSelect.SelectedItem.ToString(), this.toolStripTextBoxSelect.Text);
        //    }
        //    this.Search();
        //}

        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            var formBasePersonModify = new FormBasePersonModify();

            formBasePersonModify.SetMode(FormMode.ADD);

            formBasePersonModify.SetAddFinishedCallback((addedID) =>
            {
                this.pagerWidget.Search(false, addedID);
                var worksheet = this.reoGridControlPerson.Worksheets[0];
            });
            formBasePersonModify.Show();
        }
コード例 #2
0
        private void toolStripButtonAlter_Click(object sender, EventArgs e)
        {
            var worksheet = this.reoGridControlPerson.Worksheets[0];

            try
            {
                if (worksheet.SelectionRange.Rows != 1)
                {
                    throw new Exception();
                }
                int personID             = int.Parse(worksheet[worksheet.SelectionRange.Row, 0].ToString());
                var formBasePersonModify = new FormBasePersonModify(personID);
                formBasePersonModify.SetModifyFinishedCallback((addedID) =>
                {
                    this.pagerWidget.Search(false, addedID);
                });
                formBasePersonModify.Show();
            }
            catch
            {
                MessageBox.Show("请选择一项进行修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }