Exemplo n.º 1
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            add_employee frm = new add_employee();

            frm.Text        = "اضافة موظف جديد";
            frm.Name        = "add_employee";
            frm.txt_id.Text = increasekey(emp_id);
            frm.ShowDialog();
            this.frm_employee_Load(sender, e);
        }
Exemplo n.º 2
0
        private void btn_edit_Click(object sender, EventArgs e)
        {
            add_employee frm = new add_employee();

            frm.Text            = "تعديل بيانات الموظف";
            frm.Name            = "update_employee";
            frm.txt_id.Text     = dgv_employee.CurrentRow.Cells[0].Value.ToString();
            frm.txt_name.Text   = dgv_employee.CurrentRow.Cells[1].Value.ToString();
            frm.txt_nat_id.Text = dgv_employee.CurrentRow.Cells[10].Value.ToString();
            if (dgv_employee.CurrentRow.Cells[2].Value.ToString() == "ذكر")
            {
                frm.rdb_male.Checked = true;
            }
            else
            {
                frm.rdb_female.Checked = true;
            }
            if (dgv_employee.CurrentRow.Cells[5].Value.ToString().Substring(0, 4) == "ارمل")
            {
                frm.rdb_armal.Checked = true;
            }
            else if (dgv_employee.CurrentRow.Cells[5].Value.ToString().Substring(0, 4) == "اعزب")
            {
                frm.rdb_single.Checked = true;
            }
            else if (dgv_employee.CurrentRow.Cells[5].Value.ToString().Substring(0, 5) == "متزوج")
            {
                frm.rdb_mairried.Checked = true;
            }
            else
            {
                frm.rdb_motalk.Checked = true;
            }
            frm.dtp_birth_date.Value = Convert.ToDateTime(dgv_employee.CurrentRow.Cells[3].Value.ToString());
            //MessageBox.Show(dgv_employee.CurrentRow.Cells[4].Value.ToString());
            frm.dtb_reg_date.Value = Convert.ToDateTime(dgv_employee.CurrentRow.Cells[4].Value.ToString());
            frm.txt_address.Text   = dgv_employee.CurrentRow.Cells[6].Value.ToString();
            frm.txt_phone1.Text    = dgv_employee.CurrentRow.Cells[8].Value.ToString();
            //frm.txt_phone2.Text = dgv_employee.CurrentRow.Cells[8].Value.ToString();
            frm.txt_email.Text = dgv_employee.CurrentRow.Cells[7].Value.ToString();
            frm.ShowDialog();
            this.frm_employee_Load(sender, e);
        }