Ejemplo n.º 1
0
        private void btnAddDepart_Click(object sender, EventArgs e)
        {
            FrmAddDept addDept = new FrmAddDept();

            addDept.flag   = 1;
            addDept.DeptId = (int)dgvDepart.SelectedRows[0].Cells["deptId"].Value;
            addDept.fdm    = this;
            addDept.ShowDialog();
        }
Ejemplo n.º 2
0
 private void tsmiDeatilDepart_Click(object sender, EventArgs e)
 {
     if (dgvDepart.SelectedRows.Count == 1)
     {
         FrmAddDept addDept = new FrmAddDept();
         addDept.flag   = (int)optAED.Detail;
         addDept.DeptId = (int)dgvDepart.SelectedRows[0].Cells["deptId"].Value;
         addDept.ShowDialog();
     }
     else if (dgvDepart.SelectedRows.Count > 1)
     {
         MessageBox.Show("您选择了多个部门,请选择一个查看!");
     }
     else if (dgvDepart.SelectedRows.Count <= 0)
     {
         MessageBox.Show("您没有选择要查看的部门!");
     }
 }
Ejemplo n.º 3
0
 private void btnEditDepart_Click(object sender, EventArgs e)
 {
     if (dgvDepart.SelectedRows.Count == 1)
     {
         FrmAddDept addDept = new FrmAddDept();
         addDept.flag       = 0;
         addDept.DeptId     = (int)dgvDepart.SelectedRows[0].Cells["deptId"].Value;
         addDept.DepartName = dgvDepart.SelectedRows[0].Cells["DeptName"].Value.ToString().Trim();
         addDept.fdm        = this;
         addDept.ShowDialog();
     }
     else if (dgvDepart.SelectedRows.Count > 1)
     {
         MessageBox.Show("您选择了多个部门,请选择一个修改!");
     }
     else if (dgvDepart.SelectedRows.Count <= 0)
     {
         MessageBox.Show("您没有选择要修改的部门!");
     }
 }