Esempio n. 1
0
 void FireFilterChanged(BaseLoadFilter filter)
 {
     if (FilterChanged != null)
     {
         FilterChanged(this, new FilterEventsArgs2(filter));
     }
 }
Esempio n. 2
0
        public virtual void ResetToDefault()
        {
            BaseLoadFilter flt = GetFilter();

            flt.ResetToDefault();
            Init(flt);
        }
Esempio n. 3
0
        void filter_CloseApply(object sender, EventArgs e)
        {
            if (FilterForm == null)
            {
                return;
            }
            BaseLoadFilter flt = FilterForm.GetFilter();

            if (flt != Filter)
            {
                Filter = flt;
                ButtonFilter.ToolTipText = flt.ToString();
                FireFilterChanged(flt);
            }
        }
Esempio n. 4
0
        public void Init(BaseLoadFilter fl)
        {
            SysAuditFilter flt = fl as SysAuditFilter;

            if (flt != null)
            {
                cmbTable.SelectedText      = flt.Tbl;
                ctlFilterID.Value          = flt.ID;
                ctlFilterUser.Value        = flt.User;
                ctlFilterHost.Value        = flt.Host;
                ctlFilterApplication.Value = flt.Application;
                ctlFilterServer.Value      = flt.Server;
                ctlFilterBase.Value        = flt.Base;
            }
            else
            {
                ResetToDefault();
            }
        }
        public void ActivateController <C>(BaseLoadFilter filter)
            where C : FormController //ListFormController
        {
            //ListFormController controller = null;
            FormController controller = null;

            try
            {
                foreach (Form form in Frm.MdiChildren)
                {
                    ListForm lf = form as ListForm;
                    if (lf != null && lf.FormController.GetType() == typeof(C))
                    {
                        controller = lf.FormController;
                        lf.Activate();
                        break;
                    }
                }

                if (controller == null && filter == null)
                {
                    //controller = (ListFormController)Activator.CreateInstance(typeof(C), Frm);
                    controller = (FormController)Activator.CreateInstance(typeof(C), Frm);
                }
                else if (controller == null)
                {
                    //controller = (ListFormController)Activator.CreateInstance(typeof(C), Frm, filter);
                    controller = (FormController)Activator.CreateInstance(typeof(C), Frm, filter);
                }
                else if (filter != null)
                {
                    controller.InitFilter(filter);
                    controller.Refresh();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.ExMessage(ex), "Ошибка");
            }
        }
Esempio n. 6
0
 void ButtonReset_Click(object sender, EventArgs e)
 {
     if (_FilterForm != null)
     {
         if (ButtonFilter != null && ButtonFilter.Owner != null)
         {
             ButtonFilter.Owner.TopLevelControl.Cursor = Cursors.WaitCursor;
         }
         try
         {
             BaseLoadFilter flt = _FilterForm.GetFilter();
             flt.ResetToDefault();
             _FilterForm.Init(flt);
             FireFilterChanged(flt);
         }
         finally
         {
             if (ButtonFilter != null && ButtonFilter.Owner != null)
             {
                 ButtonFilter.Owner.TopLevelControl.Cursor = Cursors.Default;
             }
         }
     }
 }
Esempio n. 7
0
 public FilterEventsArgs2(BaseLoadFilter filter)
 {
     Filter = filter;
 }
Esempio n. 8
0
 public virtual void InitFilter(BaseLoadFilter loadfilter)
 {
 }
Esempio n. 9
0
        public TreeListFormController(Form mdiForm, string name, string caption, Icon icon, bool TreePanel, bool EntityPanel, BaseLoadFilter loadfilter)
            : base(mdiForm, name, caption, icon, TreePanel, EntityPanel)
        {
            PaintPanels((TreePanel) ? 320 : 0, (EntityPanel) ? 140 : 0);
            //PaintPanels(TreePanel, EntityPanel);
            fltController.Init(FToolBar);
            FToolBar.Items[2].Enabled = FToolBar.Items[3].Enabled = FToolBar.Items[4].Enabled = false;

            gridMain.Init(PanelList);
            gridMain.EntityNew      += new DatEventDelegate(EntityNew);
            gridMain.EntitySelected += new DatEventDelegate(EntitySelected);
            gridMain.EntityChanged  += new DatEventDelegate(EntityChanged);

            //if (EntityPanel)
            //{
            PanelRTF             = new RichTextBox();
            PanelRTF.Dock        = DockStyle.Fill;
            PanelRTF.BackColor   = Color.LightCyan;
            PanelRTF.BorderStyle = BorderStyle.None;
            PanelRTF.ReadOnly    = true;
            PanelRTF.ScrollBars  = RichTextBoxScrollBars.Vertical;
            PanelEntity.Controls.Add(PanelRTF);

            PanelCaption        = new CtlCaptionPanel();
            PanelCaption.Active = false;
            PanelCaption.Dock   = DockStyle.Top;
            PanelEntity.Controls.Add(PanelCaption);
            //}

            TreeList.Init(SetTree, PanelTree, new CardTreeForm());
            TreeList.TreeChanged += new DatEventDelegate(TreeChanged);
            //TreeList.Reload();
            splitTL.Panel1Collapsed = false;

            gridMain.Grid.ValueEventDisabled = true;
            Show();
            gridMain.Grid.ValueEventDisabled = false;
            gridMain.Grid.FireValueChanged();
        }
Esempio n. 10
0
 public virtual void Init(BaseLoadFilter flt)
 {
 }
Esempio n. 11
0
 public ListFormControllerBase(Form mdiForm, string name, string caption, Icon icon, bool hasTree, bool hasEntity, BaseLoadFilter filter)
     : base(mdiForm, name, caption, icon)
 {
     PaintPanels(hasTree ? 70 : 0, hasEntity ? 70 : 0);
     gridMain.Init(PanelList, FForm);
     FToolBar.Visible = false;
     gridMain.Grid.ShowContextMenu = true;
     gridMain.Grid.TabStop         = false;
     Show();
     Application.DoEvents();
     Refresh();
 }
Esempio n. 12
0
 public ListFormController(Form mdiParent, BaseLoadFilter loadfilter) : this(mdiParent, "", "", null)
 {
 }