public void AgregarRol(SIGEEA_Rol rol) { DataClasses1DataContext dc = new DataClasses1DataContext(); dc.SIGEEA_Rols.InsertOnSubmit(rol); dc.SubmitChanges(); }
public void AgregarRol(SIGEEA_Rol rol) { SIGEEA_DiagramaDataContext dc = new SIGEEA_DiagramaDataContext(); dc.SIGEEA_Rols.InsertOnSubmit(rol); dc.SubmitChanges(); }
public void EditarRol(SIGEEA_Rol pRol) { SIGEEA_DiagramaDataContext dc = new SIGEEA_DiagramaDataContext(); SIGEEA_Rol editRol = dc.SIGEEA_Rols.FirstOrDefault(c => c.PK_Id_Rol == pRol.PK_Id_Rol); editRol.Nombre_Rol = pRol.Nombre_Rol; editRol.FK_Id_Permiso = pRol.FK_Id_Permiso; dc.SubmitChanges(); }
private void cbxRoles_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (cbxRoles.SelectedValue != null) { ListBoxItem nuevo = cbxRoles.SelectedValue as ListBoxItem; Rol = nuevo.DataContext as SIGEEA_Rol; CargarUsuarios(); } }
public bool ValidaNombreRol(string nombre) { SIGEEA_DiagramaDataContext dc = new SIGEEA_DiagramaDataContext(); SIGEEA_Rol editRol = dc.SIGEEA_Rols.FirstOrDefault(c => c.Nombre_Rol == nombre); if (editRol != null) { return(true); } else { return(false); } }
public wnwAgregarRol(string tipo, SIGEEA_Rol prol) { InitializeComponent(); CargarPermiso(); ptipo = tipo; if (tipo == "Editar") { txtTipo.Text = "Editar rol"; txtNomRol.Text = prol.Nombre_Rol; Permiso = segMant.ObtenerPermiso(Convert.ToInt32(prol.FK_Id_Permiso)); cbxPermiso.SelectedValue = Permiso.Nombre_Permiso; Rol = prol; primerNombre = Rol.Nombre_Rol; } }
private void cbxRoles_SelectionChanged(object sender, SelectionChangedEventArgs e) { ListBoxItem nuevo = cbxRoles.SelectedValue as ListBoxItem; Rol = nuevo.DataContext as SIGEEA_Rol; }