private void OnChange(PnlNuevoPrivilegio Privilegio) { if (Privilege != null) { Privilege(Privilegio); } }
private void InicializarPrivilegios() { if (!ContextControls.ContainsKey("PnlNuevoPrivilegio")) { PnlNuevoPrivilegio pnlNuevoPrivilegio = new PnlNuevoPrivilegio(); pnlNuevoPrivilegio.Dock = DockStyle.Fill; DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage(); tabItem.Controls.Add(pnlNuevoPrivilegio); tabItem.Text = "Lista de Privilegios"; xtraTabControl.TabPages.Add(tabItem); xtraTabControl.SelectedTabPage = tabItem; ContextControls.Add("PnlNuevoPrivilegio", pnlNuevoPrivilegio); } }
private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!(this.ParentForm as mainForm).ContextControls.ContainsKey("PnlNuevoPrivilegio")) { PnlNuevoPrivilegio pnlPrivilegios = new PnlNuevoPrivilegio( ); pnlPrivilegios.Dock = DockStyle.Fill; pnlPrivilegios.Privilege += new PnlNuevoPrivilegio.PrivilegesHandler(pnlPrivilegios_Privilege); DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add(pnlPrivilegios); tabItem.Text = "Crear/Editar Usuarios"; (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem); (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem; (this.ParentForm as mainForm).ContextControls.Add("PnlNuevoPrivilegio", pnlPrivilegios); } }
private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DataRowView selectedRow; selectedRow = ( DataRowView )gridViewUsuarios.GetFocusedRow( ); if (!(this.ParentForm as mainForm).ContextControls.ContainsKey("PnlNuevoPrivilegio")) //if (!(this.ParentForm as mainForm).ContextControlsForPrivilegios.ContainsKey(selectedRow.Row.ItemArray[0].ToString())) { PnlNuevoPrivilegio pnlPrivilegios = new PnlNuevoPrivilegio(selectedRow.Row.ItemArray[0].ToString(), selectedRow.Row.ItemArray[1].ToString( ), selectedRow.Row.ItemArray[2].ToString( ), selectedRow.Row.ItemArray[3].ToString( ), selectedRow.Row.ItemArray[4].ToString( ), selectedRow.Row.ItemArray[5].ToString( ), selectedRow.Row.ItemArray[6].ToString( )); pnlPrivilegios.Dock = DockStyle.Fill; pnlPrivilegios.Privilege += new PnlNuevoPrivilegio.PrivilegesHandler(pnlPrivilegios_Privilege); DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add(pnlPrivilegios); tabItem.Text = "Crear/Editar Usuarios"; (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem); (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem; //(this.ParentForm as mainForm).ContextControlsForPrivilegios.Add(selectedRow.Row.ItemArray[0].ToString(), pnlPrivilegios); (this.ParentForm as mainForm).ContextControls.Add("PnlNuevoPrivilegio", pnlPrivilegios); } }
private void OnChange( PnlNuevoPrivilegio Privilegio ) { if ( Privilege != null ) { Privilege( Privilegio ); } }
private void pnlPrivilegios_Privilege(PnlNuevoPrivilegio Privilegio) { InitializeGrid( ); }
private void barButtonAdd_ItemClick( object sender , DevExpress.XtraBars.ItemClickEventArgs e ) { if ( !( this.ParentForm as mainForm ).ContextControls.ContainsKey( "PnlNuevoPrivilegio" ) ) { PnlNuevoPrivilegio pnlPrivilegios = new PnlNuevoPrivilegio( ); pnlPrivilegios.Dock = DockStyle.Fill; pnlPrivilegios.Privilege += new PnlNuevoPrivilegio.PrivilegesHandler( pnlPrivilegios_Privilege ); DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add( pnlPrivilegios ); tabItem.Text = "Crear/Editar Usuarios"; ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem ); ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem; ( this.ParentForm as mainForm ).ContextControls.Add( "PnlNuevoPrivilegio" , pnlPrivilegios ); } }
private void pnlPrivilegios_Privilege( PnlNuevoPrivilegio Privilegio ) { InitializeGrid( ); }
private void barButtonEdit_ItemClick( object sender , DevExpress.XtraBars.ItemClickEventArgs e ) { DataRowView selectedRow; selectedRow = ( DataRowView ) gridViewUsuarios.GetFocusedRow( ); if ( !( this.ParentForm as mainForm ).ContextControls.ContainsKey( "PnlNuevoPrivilegio" ) ) //if (!(this.ParentForm as mainForm).ContextControlsForPrivilegios.ContainsKey(selectedRow.Row.ItemArray[0].ToString())) { PnlNuevoPrivilegio pnlPrivilegios = new PnlNuevoPrivilegio( selectedRow.Row.ItemArray[0].ToString(),selectedRow.Row.ItemArray[ 1 ].ToString( ) , selectedRow.Row.ItemArray[ 2 ].ToString( ), selectedRow.Row.ItemArray[ 3 ].ToString( ) , selectedRow.Row.ItemArray[ 4 ].ToString( ) , selectedRow.Row.ItemArray[ 5 ].ToString( ) , selectedRow.Row.ItemArray[ 6 ].ToString( ) ); pnlPrivilegios.Dock = DockStyle.Fill; pnlPrivilegios.Privilege += new PnlNuevoPrivilegio.PrivilegesHandler( pnlPrivilegios_Privilege ); DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( ); tabItem.Controls.Add( pnlPrivilegios ); tabItem.Text = "Crear/Editar Usuarios"; ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem ); ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem; //(this.ParentForm as mainForm).ContextControlsForPrivilegios.Add(selectedRow.Row.ItemArray[0].ToString(), pnlPrivilegios); ( this.ParentForm as mainForm ).ContextControls.Add( "PnlNuevoPrivilegio" , pnlPrivilegios ); } }