Ejemplo n.º 1
0
        private void btViewDict_Click(object sender, EventArgs e)
        {
            if (this.ValidateChildren())
            {
                FormDialog dform = new FormDialog();
                dform.Text = "Справочник : группы";

                UCSimpleDirectory ucSimpleDirectory = new UCSimpleDirectory((this.bindingSource.DataSource as DataView).Table.ParentRelations[0].ParentTable);

                dform.panel.Controls.Add(ucSimpleDirectory);


                if (DialogResult.OK == dform.ShowDialog(this))
                {
                    MessageBox.Show(ucSimpleDirectory.gridView.GetDataRow(ucSimpleDirectory.gridView.GetSelectedRows()[0])["ID"].ToString());
                    //  (this.Controls.Find((sender as Button).Tag.ToString() + "lookUpEdit", true)[0] as DevExpress.XtraEditors.LookUpEdit).EditValue = ucSimpleDirectory.gridView.GetDataRow(ucSimpleDirectory.gridView.GetSelectedRows()[0])["ID"];
                }
            }
        }
Ejemplo n.º 2
0
        private bool ShowNewSimpleDirectotyTab(string TagControl, string Title, params object[] list)
        {
            if (!FindOpenedTabs(TagControl))
            {
                UCSimpleDirectory ucSimpleDirectory = new UCSimpleDirectory(this.mDataSet.Tables[TagControl]);
                ucSimpleDirectory.errorProvider1.DataSource = this.mDataSet;

                ucSimpleDirectory.gridView.FocusedRowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle;
                ucSimpleDirectory.gridView.FocusedColumn    = ucSimpleDirectory.gridView.Columns["Name"];
                ucSimpleDirectory.Dock = DockStyle.Fill;
                ucSimpleDirectory.Tag  = Title;
                TabPage newTab = new TabPage(Title);
                newTab.Controls.Add(ucSimpleDirectory);
                tabControl.TabPages.Add(newTab);
                tabControl.TabPages[tabControl.TabCount - 1].Tag = TagControl;
                tabControl.SelectedTab = newTab;

                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
         private void btSimpleDirectory_Click(object sender, EventArgs e)
        {
            FormDialog dform = new FormDialog();
            dform.Text = this.toolTip1.GetToolTip((sender as Control)).ToString();

            int _id =Convert.ToInt32( (this.Controls.Find((sender as Button).Tag.ToString()+"lookUpEdit", true)[0] as  DevExpress.XtraEditors.LookUpEdit).EditValue);


            DataTable _table = (this.productBindingSource.DataSource as DataRow).Table.DataSet.Tables[(sender as Button).Tag.ToString()];

            UCSimpleDirectory ucSimpleDirectory = new UCSimpleDirectory(_table,_id);
            ucSimpleDirectory.btClose.Visible = false;
            dform.panel.Controls.Add(ucSimpleDirectory);

            ucSimpleDirectory.bindingSource.CurrencyManager.Position = ucSimpleDirectory.bindingSource.Find("ID", _id);
         
           
            if (DialogResult.OK == dform.ShowDialog(this))
            { 
               (this.Controls.Find((sender as Button).Tag.ToString()+"lookUpEdit", true)[0] as  DevExpress.XtraEditors.LookUpEdit).EditValue = ucSimpleDirectory.gridView.GetDataRow(ucSimpleDirectory.gridView.GetSelectedRows()[0])["ID"];
            }
  
        }
Ejemplo n.º 4
0
        private void btSimpleDirectory_Click(object sender, EventArgs e)
        {
            FormDialog dform = new FormDialog();

            dform.Text = this.toolTip1.GetToolTip((sender as Control)).ToString();

            int _id = Convert.ToInt32((this.Controls.Find((sender as Button).Tag.ToString() + "lookUpEdit", true)[0] as  DevExpress.XtraEditors.LookUpEdit).EditValue);


            DataTable _table = (this.productBindingSource.DataSource as DataRow).Table.DataSet.Tables[(sender as Button).Tag.ToString()];

            UCSimpleDirectory ucSimpleDirectory = new UCSimpleDirectory(_table, _id);

            ucSimpleDirectory.btClose.Visible = false;
            dform.panel.Controls.Add(ucSimpleDirectory);

            ucSimpleDirectory.bindingSource.CurrencyManager.Position = ucSimpleDirectory.bindingSource.Find("ID", _id);


            if (DialogResult.OK == dform.ShowDialog(this))
            {
                (this.Controls.Find((sender as Button).Tag.ToString() + "lookUpEdit", true)[0] as  DevExpress.XtraEditors.LookUpEdit).EditValue = ucSimpleDirectory.gridView.GetDataRow(ucSimpleDirectory.gridView.GetSelectedRows()[0])["ID"];
            }
        }
Ejemplo n.º 5
0
        private bool ShowNewSimpleDirectotyTab(string TagControl, string Title, params object[] list)
        {
            if (!FindOpenedTabs(TagControl))
            {
                
            UCSimpleDirectory ucSimpleDirectory = new UCSimpleDirectory(this.mDataSet.Tables[TagControl]);
            ucSimpleDirectory.errorProvider1.DataSource = this.mDataSet;
            
            ucSimpleDirectory.gridView.FocusedRowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle;
            ucSimpleDirectory.gridView.FocusedColumn = ucSimpleDirectory.gridView.Columns["Name"];
            ucSimpleDirectory.Dock = DockStyle.Fill;
            ucSimpleDirectory.Tag = Title;
            TabPage newTab = new TabPage(Title);
            newTab.Controls.Add(ucSimpleDirectory);
            tabControl.TabPages.Add(newTab);
            tabControl.TabPages[tabControl.TabCount - 1].Tag = TagControl;
            tabControl.SelectedTab = newTab;

                return true;
            }
            return false;
        }
Ejemplo n.º 6
0
        private void btViewDict_Click(object sender, EventArgs e)
        {
            if (this.ValidateChildren())
            {
                FormDialog dform = new FormDialog();
                dform.Text = "Справочник : группы";

                UCSimpleDirectory ucSimpleDirectory = new UCSimpleDirectory((this.bindingSource.DataSource as DataView).Table.ParentRelations[0].ParentTable);

                dform.panel.Controls.Add(ucSimpleDirectory);


                if (DialogResult.OK == dform.ShowDialog(this))
                {
                    MessageBox.Show(ucSimpleDirectory.gridView.GetDataRow(ucSimpleDirectory.gridView.GetSelectedRows()[0])["ID"].ToString());
                    //  (this.Controls.Find((sender as Button).Tag.ToString() + "lookUpEdit", true)[0] as DevExpress.XtraEditors.LookUpEdit).EditValue = ucSimpleDirectory.gridView.GetDataRow(ucSimpleDirectory.gridView.GetSelectedRows()[0])["ID"];
                }
            }
        }