private void btnModificar_Click(object sender, EventArgs e) { try { DataGridViewRow dr = dgvRoles.CurrentRow; DataGridViewCell cellNombre = dr.Cells["Nombre"]; DataGridViewCell cellIdRol = dr.Cells["IdRol"]; int id = Convert.ToInt32(cellIdRol.Value); String n = Convert.ToString(cellNombre.Value); View.ABM_Rol.RolAM rolMod = new RolAM(this); rolMod.Text = "Modificacion de Rol"; rolMod.asignarRolAModificar(id, n); rolMod.Visible = true; this.Visible = false; } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnEliminar_Click(object sender, EventArgs e) { try { if (dgvRoles.SelectedRows.Count == 1) { DataGridViewRow dr = dgvRoles.CurrentRow; DataGridViewCell cellNombre = dr.Cells["Nombre"]; DataGridViewCell cellIdCliente = dr.Cells["IdCliente"]; DataGridViewCell celltipoNro = dr.Cells["TipoDoc"]; DataGridViewCell cellNroDocumento = dr.Cells["NroDocumento"]; DataGridViewCell cellcuil = dr.Cells["CUIL"]; DataGridViewCell cellMail = dr.Cells["Mail"]; DataGridViewCell cellApellido = dr.Cells["Apellido"]; DataGridViewCell cellTelefono = dr.Cells["Telefono"]; DataGridViewCell cellCalle = dr.Cells["Calle"]; DataGridViewCell cellPisoNro = dr.Cells["PisoNro"]; DataGridViewCell cellDepto = dr.Cells["Depto"]; DataGridViewCell cellLocalidad = dr.Cells["Localidad"]; DataGridViewCell cellCodigoPostal = dr.Cells["CodigoPostal"]; DataGridViewCell cellFechaNacimiento = dr.Cells["FechaNacimiento"]; DataGridViewCell cellIdEstado = dr.Cells["IdEstado"]; int id = Convert.ToInt32(cellIdCliente.Value); String nombre = Convert.ToString(cellNombre.Value); String tipodoc = Convert.ToString(celltipoNro.Value); String DNI = Convert.ToString(cellNroDocumento.Value); String CUIL = Convert.ToString(cellcuil.Value); String MAIL = Convert.ToString(cellMail.Value); String apellido = Convert.ToString(cellApellido.Value); String Telefono = Convert.ToString(cellTelefono.Value); String Calle = Convert.ToString(cellCalle.Value); String PisoNro = Convert.ToString(cellPisoNro.Value); String Depto = Convert.ToString(cellDepto.Value); String Localidad = Convert.ToString(cellLocalidad.Value); int CodigoPostal = Convert.ToInt32(cellCodigoPostal.Value); DateTime FechaNacimiento = Convert.ToDateTime(cellFechaNacimiento.Value); int IdEstado = Convert.ToInt32(cellIdEstado.Value); if (IdEstado == 1) { View.ABM_Cliente.ABM_de_Cliente ClienteMod = new ABM_de_Cliente(); ClienteMod.ventana_anterior(this); ClienteMod.Text = "Baja de Cliente"; ClienteMod.asignarClienteAModificar(id, nombre, apellido, tipodoc, DNI, CUIL, MAIL, Telefono, Calle, PisoNro, Depto, Localidad, CodigoPostal, FechaNacimiento, IdEstado); ClienteMod.Visible = true; this.Visible = false; } } } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnBuscar_Click(object sender, EventArgs e) { try { llenarDataGrid(); } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnEliminar_Click(object sender, EventArgs e) { try { DataGridViewRow dr = dgvRoles.CurrentRow; DataGridViewCell cellRazonSocial = dr.Cells["RazonSocial"]; DataGridViewCell cellIdEmpresa = dr.Cells["IdEmpresa"]; DataGridViewCell cellCUIT = dr.Cells["CUIT"]; DataGridViewCell cellMail = dr.Cells["Mail"]; DataGridViewCell cellNombreContacto = dr.Cells["NombreContacto"]; DataGridViewCell cellTelefono = dr.Cells["Telefono"]; DataGridViewCell cellCalle = dr.Cells["Calle"]; DataGridViewCell cellPisoNro = dr.Cells["PisoNro"]; DataGridViewCell cellDepto = dr.Cells["Depto"]; DataGridViewCell cellLocalidad = dr.Cells["Localidad"]; DataGridViewCell cellCodigoPostal = dr.Cells["CodigoPostal"]; DataGridViewCell cellFechaCreacion = dr.Cells["FechaCreacion"]; DataGridViewCell cellIdEstado = dr.Cells["IdEstado"]; int id = Convert.ToInt32(cellIdEmpresa.Value); String RZ = Convert.ToString(cellRazonSocial.Value); String CUIT = Convert.ToString(cellCUIT.Value); String MAIL = Convert.ToString(cellMail.Value); String NombreContacto = Convert.ToString(cellNombreContacto.Value); String Telefono = Convert.ToString(cellTelefono.Value); String Calle = Convert.ToString(cellCalle.Value); String PisoNro = Convert.ToString(cellPisoNro.Value); String Depto = Convert.ToString(cellDepto.Value); String Localidad = Convert.ToString(cellLocalidad.Value); int CodigoPostal = Convert.ToInt32(cellCodigoPostal.Value); DateTime FechaCreacion = Convert.ToDateTime(cellFechaCreacion.Value); int IdEstado = Convert.ToInt32(cellIdEstado.Value); if (IdEstado == 1) { View.ABM_Empresa.AM_de_Empresa EmpresaMod = new AM_de_Empresa(); EmpresaMod.ventana_anterior(this); EmpresaMod.Text = "Baja de Empresa"; EmpresaMod.asignarEmpresaAModificar(id, RZ, CUIT, MAIL, NombreContacto, Telefono, Calle, PisoNro, Depto, Localidad, CodigoPostal, FechaCreacion, IdEstado); EmpresaMod.Visible = true; this.Visible = false; } } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnGenerar_Click_1(object sender, EventArgs e) { try { if (validarDatos()) { llenarDataGrid(); } } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnNuevo_Click(object sender, EventArgs e) { try { View.ABM_Cliente.ABM_de_Cliente vtnAlta = new ABM_de_Cliente(); vtnAlta.ventana_anterior(this); vtnAlta.Text = "Alta de Cliente"; vtnAlta.Visible = true; this.Visible = false; } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnNuevo_Click(object sender, EventArgs e) { try { View.ABM_Rol.RolAM vtnAlta = new RolAM(this); vtnAlta.Text = "Alta de Rol"; vtnAlta.Visible = true; this.Visible = false; } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }
private void btnEliminar_Click(object sender, EventArgs e) { try { DataGridViewRow dr = dgvRoles.CurrentRow; DataGridViewCell cellNombre = dr.Cells["Nombre"]; DataGridViewCell cellIdRol = dr.Cells["IdRol"]; int id = Convert.ToInt32(cellIdRol.Value); Controller.Roles.EliminarRol(id); llenarDataGrid(); } catch (Exception ex) { View.Error.ErrorForm vtnError = new View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }