コード例 #1
0
        protected void Login()
        {
            this.Hide();
            FormLogin form = new FormLogin();

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.Location    = new Point(0, 0);
                this.WindowState = FormWindowState.Maximized;
                this.Show();
                this.BringToFront();
                for (int i = 0; i < this.Controls.Count; i++)
                {
                    MdiClient client = this.Controls[i] as MdiClient;
                    if (client == null)
                    {
                        continue;
                    }
                    _mdiClient           = client;
                    _mdiClient.BackColor = Color.White;
                    break;
                }
                //判断页面
                GetUserRoles();

                LoadTreeMenu();

                ShowMenuByRoles();

                tSSLUser.Text = FishEntity.Variable.User == null ? string.Empty : FishEntity.Variable.User.realname + "(" + FishEntity.Variable.User.roletype + ")";

                DrawMdiClientBackground();

                ShowPushMessageForm();

                StartBackThread();
                //MessageBox.Show(GetMacString().ToString());

                proDic = ProgramManager.setDicItem( );

                System.Timers.Timer t = new System.Timers.Timer(1000);
                t.Elapsed  += new System.Timers.ElapsedEventHandler(checkWarn);
                t.AutoReset = true;
                t.Enabled   = true;
            }
            else
            {
                this.Close();
            }
        }
コード例 #2
0
        public FormWarn( )
        {
            InitializeComponent( );
            ReadColumnConfig(dataGridView1, "Set_148");

            _bll = new FishBll.Bll.WarnBll( );

            _model = new FishEntity.WarnEntity( );

            proDic = ProgramManager.setDicItem( );
            BindingSource bs = new BindingSource( );

            bs.DataSource           = proDic;
            comboBox1.DataSource    = bs;
            comboBox1.DisplayMember = "Value";
            comboBox1.ValueMember   = "Key";
        }
コード例 #3
0
        delegate void AsynUpdateUI( ); //定义一个委托,使其可以更新UI控件的状态

        void checkWarn(object source, System.Timers.ElapsedEventArgs e)
        {
            if (InvokeRequired)
            {
                this.Invoke(new AsynUpdateUI(delegate()
                {
                    FishBll.Bll.WarnBll _bll = new FishBll.Bll.WarnBll( );
                    DataTable table          = _bll.getWarnInfo(FishEntity.Variable.User.id, ProgramManager.setDicItem( ));
                    if (table == null || table.Rows.Count < 1)
                    {
                        return;
                    }
                    signGroupWarn(table);
                }));
            }
        }
コード例 #4
0
        //送审人
        private void comboBox8_SelectedValueChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(comboBox7.Text) && string.IsNullOrEmpty(comboBox8.Text))
            {
                //MessageBox . Show ( "请选择职位" );
                return;
            }
            comboBox8.Tag = comboBox8.SelectedValue;
            string id = comboBox8.SelectedValue.ToString( );

            proDic = ProgramManager.setDicItem( );
            Dictionary <string, string> proNewDic = new Dictionary <string, string> ( );

            proNewDic.Add("", "");

            DataTable tablePro = _bll.getTablePro(id);

            if (tablePro != null && tablePro.Rows.Count > 0)
            {
                foreach (DataRow row in tablePro.Rows)
                {
                    foreach (string key in proDic.Keys)
                    {
                        if (proDic [key].Equals(row ["funname"]))
                        {
                            if (!proNewDic.ContainsKey(key))
                            {
                                proNewDic.Add(key, proDic [key]);
                            }
                        }
                    }
                }
            }

            if (proNewDic.Count < 1)
            {
                return;
            }

            BindingSource bs1 = new BindingSource( );

            bs1.DataSource          = proNewDic;
            comboBox2.DataSource    = bs1;
            comboBox2.DisplayMember = "Value";
            comboBox2.ValueMember   = "Key";

            BindingSource bs2 = new BindingSource( );

            bs2.DataSource          = proNewDic;
            comboBox3.DataSource    = bs2;
            comboBox3.DisplayMember = "Value";
            comboBox3.ValueMember   = "Key";

            BindingSource bs3 = new BindingSource( );

            bs3.DataSource          = proNewDic;
            comboBox4.DataSource    = bs3;
            comboBox4.DisplayMember = "Value";
            comboBox4.ValueMember   = "Key";

            BindingSource bs4 = new BindingSource( );

            bs4.DataSource          = proNewDic;
            comboBox5.DataSource    = bs4;
            comboBox5.DisplayMember = "Value";
            comboBox5.ValueMember   = "Key";

            BindingSource bs5 = new BindingSource( );

            bs5.DataSource          = proNewDic;
            comboBox6.DataSource    = bs5;
            comboBox6.DisplayMember = "Value";
            comboBox6.ValueMember   = "Key";
        }