private void button4_Click(object sender, EventArgs e)
        {
            #region 判断点多少个
           
            int i;
            try
            {
                i = 0;
                foreach (DataGridViewRow dgvr in dgrd.Rows)
                {
                    if (dgvr.Cells["delckek"].Value != null && dgvr.Cells["delckek"].Value.Equals("True"))
                    {
                        //这里要处理为空的
                        try
                        {
                            intUpDateID = int.Parse(dgvr.Cells["BlockID"].Value.ToString());
                            name = dgvr.Cells["EmployeeName"].Value.ToString();
                            deptname = dgvr.Cells["DeptName"].Value.ToString();
                            strInWellDatetime = dgvr.Cells["BeginWorkTime"].Value.ToString();
                            strShortName = dgvr.Cells["ClassShortName"].Value.ToString();
                        }
                        catch(Exception ex)
                        {

                        }

                        i += 1;
                    }
                }

             
            }
            catch
            {
                intUpDateID = -1;
                i = 0;
            }
            if (i == 0)
            {
                MessageBox.Show("请选择要补单的员工", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else if (i > 1)
            {
                MessageBox.Show("所选员工不能大于1人,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                //tempEmpID = intUpDateID;
                ////GetEmpInfo_Add();
                ////pl_AddEmpInfo.Visible = true;

                ////bt_AddEmpReset.Enabled = false;

                ////bt_AddEmpSave.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = true;
                ////tbc_EmpInfo.SelectedTab = tbp_EmpBasic;

                //A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this);
                //frmAei.ShowDialog();
                //MessageBox.Show(intUpDateID.ToString());
                A_AttendanceRealTime_Add frm = new A_AttendanceRealTime_Add(this);
                frm.ShowDialog();
            }


            #endregion
            //A_AttendanceRealTime_Add frm = new A_AttendanceRealTime_Add();
            //DialogResult dr = new DialogResult();
            //dr = frm.ShowDialog();
            //if (dr == DialogResult.OK)
            //{
            //    BindDataGridView();
            //}
        }
Exemple #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            #region 判断点多少个

            int i;
            try
            {
                i = 0;
                foreach (DataGridViewRow dgvr in dgrd.Rows)
                {
                    if (dgvr.Cells["delckek"].Value != null && dgvr.Cells["delckek"].Value.Equals("True"))
                    {
                        //这里要处理为空的
                        try
                        {
                            intUpDateID       = int.Parse(dgvr.Cells["BlockID"].Value.ToString());
                            name              = dgvr.Cells["EmployeeName"].Value.ToString();
                            deptname          = dgvr.Cells["DeptName"].Value.ToString();
                            strInWellDatetime = dgvr.Cells["BeginWorkTime"].Value.ToString();
                            strShortName      = dgvr.Cells["ClassShortName"].Value.ToString();
                        }
                        catch (Exception ex)
                        {
                        }

                        i += 1;
                    }
                }
            }
            catch
            {
                intUpDateID = -1;
                i           = 0;
            }
            if (i == 0)
            {
                MessageBox.Show("请选择要补单的员工", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else if (i > 1)
            {
                MessageBox.Show("所选员工不能大于1人,请重新选择!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                //tempEmpID = intUpDateID;
                ////GetEmpInfo_Add();
                ////pl_AddEmpInfo.Visible = true;

                ////bt_AddEmpReset.Enabled = false;

                ////bt_AddEmpSave.Enabled = groupBox1.Enabled = groupBox3.Enabled = groupBox4.Enabled = groupBox5.Enabled = groupBox6.Enabled = true;
                ////tbc_EmpInfo.SelectedTab = tbp_EmpBasic;

                //A_FrmEmpInfo_AddEmpInfo frmAei = new A_FrmEmpInfo_AddEmpInfo(this);
                //frmAei.ShowDialog();
                //MessageBox.Show(intUpDateID.ToString());
                A_AttendanceRealTime_Add frm = new A_AttendanceRealTime_Add(this);
                frm.ShowDialog();
            }


            #endregion
            //A_AttendanceRealTime_Add frm = new A_AttendanceRealTime_Add();
            //DialogResult dr = new DialogResult();
            //dr = frm.ShowDialog();
            //if (dr == DialogResult.OK)
            //{
            //    BindDataGridView();
            //}
        }