Esempio n. 1
0
        private bool m_ListIsLoad = false;                  //列表项是否已载入

        /// <summary>
        /// 用于设置某一账号默认搜索条件、搜索列表及搜索排序的设置窗体。
        /// </summary>
        /// <param name="application">应用程序框架。</param>
        /// <param name="account">操作员账号。</param>
        public DeviceSearchSettingForm(FormApplicationClass application, IAccount account)
        {
            this.m_Application      = application;
            this.m_Account          = account;
            this.DeviceSearchConfig = this.m_Application.GetAccountConfig(this.m_Account, typeof(DeviceSearchAccountConfig)) as DeviceSearchAccountConfig;

            InitializeComponent();
        }
        /// <summary>
        /// 检查全局插件能否使用。
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        public bool Check(FormApplicationClass application)
        {
            ClassifySearch _Search = new ClassifySearch(application);

            _Search.Filters.Add(new ParentIdFilter(0));
            _Search.Filters.Add(new ClassifyTypeFilter(typeof(CommonCustomClassify)));
            return(_Search.Search().Count > 0);
        }
Esempio n. 3
0
        /// <summary>
        /// 设置应用程序框架。
        /// </summary>
        /// <param name="application"></param>
        public void SetApplication(FormApplicationClass application)
        {
            this.m_Application = application;

            ClassifySearch _Search = new ClassifySearch(this.m_Application);

            _Search.Filters.Add(new ParentIdFilter(0));
            _Search.Filters.Add(new ClassifyTypeFilter(typeof(Department)));
            this.Add(_Search.Search(), this.tvClassify.Nodes);

            if (this.tvClassify.Nodes.Count > 0)
            {
                this.tvClassify.ExpandAll();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 设置应用程序框架。
        /// </summary>
        /// <param name="application">应用程序框架。</param>
        public void SetApplication(FormApplicationClass application)
        {
            this.m_Application = application;

            ClassifySearch _Search = new ClassifySearch(this.m_Application);

            _Search.Filters.Add(new ParentIdFilter(0));
            _Search.Filters.Add(new ClassifyTypeFilter(typeof(CommonCustomClassify)));
            foreach (CommonCustomClassify _Classify in _Search.Search())
            {
                this.tabClassify.TabPages.Add(new CommonCustomClassifyManageTabPage(_Classify));
            }

            this.tabClassify_SelectedIndexChanged(null, null);
        }
Esempio n. 5
0
        /// <summary>
        /// 数据库连接选择控件。可以通过 Db 属性获取或设置操作员当前选择的数据库连接信息。
        /// </summary>
        /// <param name="application"></param>
        /// <param name="dbs">已配置的数据库连接信息。如果操作员选择某种数据库类型且该类型存在该数组中,则使用该已配置的数据库类型加载界面,否则界面显示默认空白值。</param>
        public DbSelection(FormApplicationClass application, IEnumerable <IDb> dbs)
        {
            this.Application = application;
            this.m_Dbs       = dbs;

            this.gbDbConfig      = new GroupBox();
            this.gbDbConfig.Dock = DockStyle.Fill;
            this.Controls.Add(this.gbDbConfig);

            Panel panDbType = new Panel();

            panDbType.Dock = DockStyle.Top;
            panDbType.Size = new System.Drawing.Size(0, 20);
            this.Controls.Add(panDbType);

            cmbDbType                       = new ComboBox();
            cmbDbType.Dock                  = DockStyle.Left;
            cmbDbType.Size                  = new System.Drawing.Size(140, 20);
            cmbDbType.DropDownStyle         = ComboBoxStyle.DropDownList;
            cmbDbType.SelectedIndexChanged += new EventHandler(cmbDbType_SelectedIndexChanged);
            foreach (DbType dbType in application.DbTypes)
            {
                if (this.Application.GetControlTypes(dbType.Type).Count > 0)
                {
                    cmbDbType.Items.Add(dbType);
                }
            }
            if (cmbDbType.Items.Count > 0)
            {
                cmbDbType.SelectedIndex = 0;
            }
            panDbType.Controls.Add(cmbDbType);

            Label labDbType = new Label();

            labDbType.Dock      = System.Windows.Forms.DockStyle.Left;
            labDbType.Size      = new System.Drawing.Size(80, 20);
            labDbType.Text      = "数据库类型:";
            labDbType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            panDbType.Controls.Add(labDbType);
        }
Esempio n. 6
0
 /// <summary>
 /// 设置应用程序框架。
 /// </summary>
 /// <param name="application">应用程序框架。</param>
 public void SetApplication(FormApplicationClass application)
 {
 }
 /// <summary>
 /// 设置应用程序框架。
 /// </summary>
 /// <param name="application">应用程序框架。</param>
 public void SetApplication(FormApplicationClass application)
 {
     this.m_Application = (WindowsFormApplicationClass)application;
     this.Image         = Properties.Resources.DeviceSearch16;
 }
Esempio n. 8
0
 /// <summary>
 /// 设置应用程序框架。
 /// </summary>
 /// <param name="application">应用程序框架。</param>
 public void SetApplication(FormApplicationClass application)
 {
     this.m_Application = application;
 }
Esempio n. 9
0
 /// <summary>
 /// 设置应用程序框架。
 /// </summary>
 /// <param name="application">应用程序框架。</param>
 public void SetApplication(FormApplicationClass application)
 {
     this.m_Application = (WindowsFormApplicationClass)application;
 }
Esempio n. 10
0
        /// <summary>
        /// 数据库类型选择窗体。可以通过 Db 属性获取或设置操作员当前选择的数据库连接信息。
        /// </summary>
        /// <param name="application"></param>
        public DbSelectionForm(FormApplicationClass application)
        {
            this.lstDbs = new List <IDb>();
            IDb dbDefault = null;

            //删除了属性(XML) DbSelection
            //if (Properties.Settings.Default.DbSelection != null)
            //{
            //    System.Xml.XmlDocument xmlDoc = Properties.Settings.Default.DbSelection;
            //    if (xmlDoc.ChildNodes.Count > 0)
            //    {
            //        foreach (System.Xml.XmlNode xnDb in xmlDoc.ChildNodes[0].ChildNodes)
            //        {
            //            System.Xml.XmlNode xaDbType = xnDb.Attributes.GetNamedItem("DbType");
            //            string strDbType = xaDbType.InnerText;

            //            foreach (DbType dbType in application.DbTypes)
            //            {
            //                if (dbType.Type.FullName.Equals(strDbType))
            //                {
            //                    IDb db = dbType.CreateDb();
            //                    db.SetConfig(xnDb);

            //                    this.lstDbs.Add(db);


            //                    if (xnDb.Attributes.GetNamedItem("Default") != null)
            //                    {
            //                        dbDefault = db;
            //                    }
            //                    break;
            //                }
            //            }
            //        }
            //    }
            //}

            this.Padding       = new System.Windows.Forms.Padding(8);
            this.Size          = new Size(480, 320);
            this.ShowIcon      = false;
            this.MaximizeBox   = false;
            this.MinimizeBox   = false;
            this.ShowInTaskbar = false;
            this.Text          = "选择数据库类型";

            this.m_DbSelection      = new DbSelection(application, this.lstDbs);
            this.m_DbSelection.Dock = DockStyle.Fill;
            this.Controls.Add(this.m_DbSelection);

            if (dbDefault != null)
            {
                this.m_DbSelection.Db = dbDefault;
            }

            Panel  panButton  = new System.Windows.Forms.Panel();
            Panel  panButton2 = new System.Windows.Forms.Panel();
            Button btnCancel  = new System.Windows.Forms.Button();
            Panel  panButton3 = new System.Windows.Forms.Panel();
            Button btnAccept  = new System.Windows.Forms.Button();

            panButton.Controls.Add(panButton2);
            panButton.Dock     = System.Windows.Forms.DockStyle.Bottom;
            panButton.Location = new System.Drawing.Point(8, 237);
            panButton.Padding  = new System.Windows.Forms.Padding(0, 5, 0, 0);
            panButton.Size     = new System.Drawing.Size(389, 28);

            panButton2.Controls.Add(btnCancel);
            panButton2.Controls.Add(panButton3);
            panButton2.Controls.Add(btnAccept);
            panButton2.Dock     = System.Windows.Forms.DockStyle.Right;
            panButton2.Location = new System.Drawing.Point(226, 5);
            panButton2.Size     = new System.Drawing.Size(163, 23);

            btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            btnCancel.Dock         = System.Windows.Forms.DockStyle.Left;
            btnCancel.Location     = new System.Drawing.Point(80, 0);
            btnCancel.Size         = new System.Drawing.Size(75, 23);
            btnCancel.Text         = "取消";
            this.CancelButton      = btnCancel;

            panButton3.Dock     = System.Windows.Forms.DockStyle.Left;
            panButton3.Location = new System.Drawing.Point(75, 0);
            panButton3.Size     = new System.Drawing.Size(5, 23);

            btnAccept.Dock     = System.Windows.Forms.DockStyle.Left;
            btnAccept.Location = new System.Drawing.Point(0, 0);
            btnAccept.Size     = new System.Drawing.Size(75, 23);
            btnAccept.Text     = "确定";
            btnAccept.Click   += new EventHandler(btnAccept_Click);
            this.AcceptButton  = btnAccept;

            this.Controls.Add(panButton);
        }