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

            frm.flag = true;

            AddOwnedForm(frm);
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.TopLevel        = false;
            frm.Dock            = DockStyle.Fill;
            this.Controls.Add(frm);
            this.Tag = frm;
            frm.BringToFront();
            frm.Show();
        }
Exemplo n.º 2
0
        private void BtnModify_Click(object sender, EventArgs e)
        {
            frmUser frm = new frmUser();

            frm.flag = false;

            AddOwnedForm(frm);
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.TopLevel        = false;
            frm.Dock            = DockStyle.Fill;
            this.Controls.Add(frm);
            this.Tag = frm;
            frm.cboPrivilege.Enabled = false;

            String cod = dgvSearch.CurrentRow.Cells[0].Value.ToString();

            AlmacenDisecWS.employee emp = new AlmacenDisecWS.employee();
            emp = serviceDA.EmployeeByCode(cod);

            frm.lblId.Text          = emp.employee_id.ToString();
            frm.txtCode.Text        = emp.eployee_code;
            frm.txtName.Text        = emp.employee_name;
            frm.txtLastName1.Text   = emp.last_name;
            frm.txtLastName2.Text   = emp.second_last_name;
            frm.txtEmail.Text       = emp.email_employee;
            frm.txtDNI.Text         = emp.dni;
            frm.txtPassword.Enabled = false;
            frm.txtSalary.Text      = emp.salary.ToString();
            frm.cboPrivilege.Text   = dgvSearch.CurrentRow.Cells[8].Value.ToString();
            frm.btnDelete.Enabled   = true;
            if (emp.gender == "F")
            {
                frm.rbWoman.Checked = true;
            }
            else
            {
                frm.rbMan.Checked = true;
            }


            frm.BringToFront();
            frm.Show();
        }