//public void GrabarEmpresas(){ // clsUsuarioPorEmpresa oUsuarioPoEmpresa = new clsUsuarioPorEmpresa(); // oUsuarioPoEmpresa.IdUsuario = Convert.ToInt32(txtCedula.Text); // foreach (DataRowView item in checkedListBox1.CheckedItems) // { // oUsuarioPoEmpresa.IdUsuario = Convert.ToInt32(txtCedula.Text); // oUsuarioPoEmpresa.IdEmpresa = Convert.ToInt32(item[checkedListBox1.ValueMember].ToString()); // //oUsuarioPoEmpresa.IdEmpresa = Convert.ToInt32(checkedListBox1.SelectedValue); // if (datUsuarioPorEmpresa.GuardarEmpresa(oUsuarioPoEmpresa)) // MessageBox.Show("Guardado UsuarioPorEmpresa con exito"); // else // MessageBox.Show("No Guardado"); // } //} private void simpleButton3_Click(object sender, EventArgs e) { frmConsultaGeneral of = new frmConsultaGeneral(); of.ShowDialog(); if (of.Codigo != String.Empty) { txtCedula.Text = of.Codigo; txtNombre.Text = of.Nombre; txtApellido.Text = of.Apellido; txtGenero.Text = of.Genero; txtTipoPersona.Text = (of.TipoPersona == "1") ? "Natural" : "Juridica"; if (txtCedula.Text == "") { } else { if (datUsuario.ConsultarPorId(Convert.ToInt32(of.Codigo)) == true) { Consulta(); } else { MessageBox.Show("Personal sin Usuario", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Information); crearNombreUsuario(); } } } of = null; }
//public void GrabarEmpresas(){ // clsUsuarioPorEmpresa oUsuarioPoEmpresa = new clsUsuarioPorEmpresa(); // oUsuarioPoEmpresa.IdUsuario = Convert.ToInt32(txtCedula.Text); // foreach (DataRowView item in checkedListBox1.CheckedItems) // { // oUsuarioPoEmpresa.IdUsuario = Convert.ToInt32(txtCedula.Text); // oUsuarioPoEmpresa.IdEmpresa = Convert.ToInt32(item[checkedListBox1.ValueMember].ToString()); // //oUsuarioPoEmpresa.IdEmpresa = Convert.ToInt32(checkedListBox1.SelectedValue); // if (datUsuarioPorEmpresa.GuardarEmpresa(oUsuarioPoEmpresa)) // MessageBox.Show("Guardado UsuarioPorEmpresa con exito"); // else // MessageBox.Show("No Guardado"); // } //} private void simpleButton3_Click(object sender, EventArgs e) { frmConsultaGeneral of = new frmConsultaGeneral(); of.ShowDialog(); per = of.oPersona; if (Convert.ToString(per.IdPersona) != "0")//if (of.Codigo != String.Empty) { txtCedula.Text = per.IdPersona.ToString(); txtNombre.Text = per.NombreRazonSocial.ToString(); txtApellido.Text = per.Apellido.ToString(); txtGenero.Text = per.genero.ToString(); txtTipoPersona.Text = (per.IdTipoPersona.ToString() == "1") ? "Natural" : "Jurídica"; //txtCedula.Text = of.Codigo; //txtNombre.Text = of.Nombre; //txtApellido.Text = of.Apellido; //txtGenero.Text = of.Genero; //txtTipoPersona.Text = (of.TipoPersona == "1") ? "Natural" : "Jurídica"; if (txtCedula.Text == "") { } else { if (datUsuario.ConsultarPorId(Convert.ToInt32(per.IdPersona)) == true) { Consulta(); } else { MessageBox.Show("Personal sin Usuario", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Information); crearNombreUsuario(); } } } of = null; }