Ejemplo n.º 1
0
        //method called after a new insumo is created. If the recipe is being edited this method is not
        //called
        private void ResetFields()
        {
            int selectedTabIndex = (this.ParentForm as mainForm).xtraTabControl.SelectedTabPageIndex;

            NuevoInsumo pnlInsumo = new NuevoInsumo();

            pnlInsumo.Dock = DockStyle.Fill;
            DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage();
            tabItem.Controls.Add(pnlInsumo);
            tabItem.Text = "nuevo insumo";
            (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
            (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;
            (this.ParentForm as mainForm).xtraTabControl.TabPages.RemoveAt(selectedTabIndex);
        }
Ejemplo n.º 2
0
        private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //if ( !( this.ParentForm as mainForm ).ContextControls.ContainsKey( "NuevoInsumo" ) )
            {
                NuevoInsumo pnlInsumo = new NuevoInsumo( );
                pnlInsumo.Dock = DockStyle.Fill;
                DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                tabItem.Controls.Add(pnlInsumo);
                tabItem.Text = "nuevo insumo";
                (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
                (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;

                //    ( this.ParentForm as mainForm ).ContextControls.Add( "NuevoInsumo" , pnlInsumo );
            }
        }
Ejemplo n.º 3
0
        private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            CommonUtils.Insumo updateInsumo = (CommonUtils.Insumo)gridViewListaInsumos.GetFocusedRow();//((DevExpress.XtraGrid.Views.Grid.GridView)gridControlListaInsumos.Views[0]).GetFocusedRow();
            if (updateInsumo != null)
            {
                if (!(this.ParentForm as mainForm).ContextControlsForInsumo.ContainsKey(updateInsumo.idInsumo.ToString()))
                {
                    NuevoInsumo pnlInsumo = new NuevoInsumo(updateInsumo);
                    (this.ParentForm as mainForm).ContextControlsForInsumo.Add(updateInsumo.idInsumo.ToString(), pnlInsumo);
                    pnlInsumo.Dock = DockStyle.Fill;
                    DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                    tabItem.Controls.Add(pnlInsumo);
                    tabItem.Text = pnlInsumo.Insumo.nombre;
                    (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
                    (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;

                    // ( this.ParentForm as mainForm ).ContextControls.Add( updateInsumo.idInsumo.ToString() , pnlInsumo );
                }
            }
        }
Ejemplo n.º 4
0
        private void barButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //if ( !( this.ParentForm as mainForm ).ContextControls.ContainsKey( "NuevoInsumo" ) )
            {
                NuevoInsumo pnlInsumo = new NuevoInsumo( );
                pnlInsumo.Dock = DockStyle.Fill;
                DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                tabItem.Controls.Add( pnlInsumo );
                tabItem.Text = "nuevo insumo";
                ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem );
                ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem;

            //    ( this.ParentForm as mainForm ).ContextControls.Add( "NuevoInsumo" , pnlInsumo );
            }
        }
Ejemplo n.º 5
0
        private void barButtonEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            CommonUtils.Insumo updateInsumo = (CommonUtils.Insumo)gridViewListaInsumos.GetFocusedRow();//((DevExpress.XtraGrid.Views.Grid.GridView)gridControlListaInsumos.Views[0]).GetFocusedRow();
            if (updateInsumo != null)
            {
                if ( !( this.ParentForm as mainForm ).ContextControlsForInsumo.ContainsKey( updateInsumo.idInsumo.ToString() ) )
                {
                    NuevoInsumo pnlInsumo = new NuevoInsumo( updateInsumo );
                    (this.ParentForm as mainForm).ContextControlsForInsumo.Add(updateInsumo.idInsumo.ToString(), pnlInsumo);
                    pnlInsumo.Dock = DockStyle.Fill;
                    DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage( );
                    tabItem.Controls.Add( pnlInsumo );
                    tabItem.Text = pnlInsumo.Insumo.nombre;
                    ( this.ParentForm as mainForm ).xtraTabControl.TabPages.Add( tabItem );
                    ( this.ParentForm as mainForm ).xtraTabControl.SelectedTabPage = tabItem;

                   // ( this.ParentForm as mainForm ).ContextControls.Add( updateInsumo.idInsumo.ToString() , pnlInsumo );
                }
            }
        }
Ejemplo n.º 6
0
        //method called after a new insumo is created. If the recipe is being edited this method is not 
        //called
        private void ResetFields()
        {
            int selectedTabIndex = (this.ParentForm as mainForm).xtraTabControl.SelectedTabPageIndex;

            NuevoInsumo pnlInsumo = new NuevoInsumo();
            pnlInsumo.Dock = DockStyle.Fill;
            DevExpress.XtraTab.XtraTabPage tabItem = new DevExpress.XtraTab.XtraTabPage();
            tabItem.Controls.Add(pnlInsumo);
            tabItem.Text = "nuevo insumo";
            (this.ParentForm as mainForm).xtraTabControl.TabPages.Add(tabItem);
            (this.ParentForm as mainForm).xtraTabControl.SelectedTabPage = tabItem;
            (this.ParentForm as mainForm).xtraTabControl.TabPages.RemoveAt(selectedTabIndex);
        }