Пример #1
0
        private void btnLaws_Click(object sender, EventArgs e)
        {
            DataGridViewRow r = null;
            int             i = 0;

            foreach (DataGridViewRow row in dgvMain.Rows)
            {
                if (row.Cells["ClmDelete"].Value != null)
                {
                    if (row.Cells["ClmDelete"].Value.Equals("True"))
                    {
                        i++;
                        if (i > 1)
                        {
                            break;
                        }
                        r = row;
                    }
                }
            }

            if (i == 0)
            {
                MessageBox.Show("请选择要修改的请假设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            else if (i > 1)
            {
                MessageBox.Show("所选请假设置不能大于1个,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            if (r != null)
            {
                NewHolidayTypeSetAdd frmHoilidayTypeAdd = new NewHolidayTypeSetAdd(2, this);
                frmHoilidayTypeAdd.DgvRow = r;
                frmHoilidayTypeAdd.ShowDialog(this);
                btnSelectAll.Text = "全选";
            }
        }
Пример #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            NewHolidayTypeSetAdd frmHoilidayTypeAdd = new NewHolidayTypeSetAdd(1, this);

            frmHoilidayTypeAdd.ShowDialog(this);
        }
Пример #3
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     NewHolidayTypeSetAdd frmHoilidayTypeAdd = new NewHolidayTypeSetAdd(1, this);
     frmHoilidayTypeAdd.ShowDialog(this);
 }
Пример #4
0
        private void btnLaws_Click(object sender, EventArgs e)
        {
            DataGridViewRow r = null;
            int i = 0;
            foreach (DataGridViewRow row in dgvMain.Rows)
            {
                if (row.Cells["ClmDelete"].Value != null)
                {
                    if (row.Cells["ClmDelete"].Value.Equals("True"))
                    {
                        i++;
                        if (i > 1)
                        {
                            break;
                        }
                        r = row;
                    }
                }
            }

            if (i == 0)
            {
                MessageBox.Show("请选择要修改的请假设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            else if (i > 1)
            {
                MessageBox.Show("所选请假设置不能大于1个,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            if (r != null)
            {
                NewHolidayTypeSetAdd frmHoilidayTypeAdd = new NewHolidayTypeSetAdd(2, this);
                frmHoilidayTypeAdd.DgvRow = r;
                frmHoilidayTypeAdd.ShowDialog(this);
                btnSelectAll.Text = "全选";
            }
        }