示例#1
0
        void RefreshLinkageWindowControl(CWindowControl WindowControl)
        {
            List <Control> lstCtrls = new List <Control>();

            foreach (Control ctrl in panelTop.Controls)
            {
                lstCtrls.Add(ctrl);
            }
            foreach (Control ctrl in panelBottom.Controls)
            {
                lstCtrls.Add(ctrl);
            }
            foreach (Control ctrl in panelLeft.Controls)
            {
                lstCtrls.Add(ctrl);
            }
            foreach (Control ctrl in panelRight.Controls)
            {
                lstCtrls.Add(ctrl);
            }
            foreach (Control ctrl in panelFill.Controls)
            {
                lstCtrls.Add(ctrl);
            }

            List <CBaseObject> lstLT = WindowControl.LinkageWindowControlMgr.GetList();

            foreach (CBaseObject obj in lstLT)
            {
                CLinkageWindowControl LinkageWindowControl = (CLinkageWindowControl)obj;
                CWindowControl        swc = (CWindowControl)WindowControl.m_ObjectMgr.Find(LinkageWindowControl.SlaveID);
                if (swc != null)
                {
                    foreach (Control ctrl in lstCtrls)
                    {
                        if ((CWindowControl)(ctrl.Tag) == swc)
                        {
                            IWindowCtrl winCtrl = (IWindowCtrl)ctrl;
                            if (winCtrl.GetCtrlType() == ControlType.TableGrid)
                            {
                                TableGrid teLT = (TableGrid)ctrl;

                                CTableInWindowControl tiw = teLT.TableInWindowControl;
                                string sQueryFilter       = tiw.QueryFilter;
                                if (CalcUIFormula(ref sQueryFilter))
                                {
                                    teLT.BaseObjectMgr.GetList(sQueryFilter);
                                    teLT.LoadData();
                                }
                            }
                            else if (winCtrl.GetCtrlType() == ControlType.TableTab)
                            {
                                TableTab tabLT = (TableTab)ctrl;
                                foreach (TabPage page in tabLT.tabControl.TabPages)
                                {
                                    TableGrid             teLT = (TableGrid)page.Controls[0];
                                    CTableInWindowControl tiw  = teLT.TableInWindowControl;
                                    string sQueryFilter        = tiw.QueryFilter;
                                    if (CalcUIFormula(ref sQueryFilter))
                                    {
                                        teLT.BaseObjectMgr.GetList(sQueryFilter);
                                        teLT.LoadData();
                                    }
                                }
                            }
                            else if (winCtrl.GetCtrlType() == ControlType.ListBox)
                            {
                                UIListBox listBoxLT = (UIListBox)ctrl;

                                CTableInWindowControl tiw = listBoxLT.TableInWindowControl;
                                string sQueryFilter       = tiw.QueryFilter;
                                if (CalcUIFormula(ref sQueryFilter))
                                {
                                    listBoxLT.BaseObjectMgr.GetList(sQueryFilter);
                                    listBoxLT.LoadData();
                                }
                            }
                            else if (winCtrl.GetCtrlType() == ControlType.ComboBox)
                            {
                                UIComboBox combBoxLT = (UIComboBox)ctrl;

                                CTableInWindowControl tiw = combBoxLT.TableInWindowControl;
                                string sQueryFilter       = tiw.QueryFilter;
                                if (CalcUIFormula(ref sQueryFilter))
                                {
                                    combBoxLT.BaseObjectMgr.GetList(sQueryFilter);
                                    combBoxLT.LoadData();
                                }
                            }
                        }
                    }
                }
            }
        }