示例#1
0
 public frm_globalSetting()
 {
     InitializeComponent();
     bll                    = new SettingBLL();
     settings               = bll.GetDefaultSetting();
     tb_address.Text        = settings.AddrChs;
     tb_addressEng.Text     = settings.AddrEng;
     tb_auth.Text           = settings.VerificationNo;
     tb_email.Text          = settings.Email;
     tb_fax.Text            = settings.Fax;
     tb_standard1.Text      = settings.Standard1;
     tb_standard2.Text      = settings.Standard2;
     tb_tel.Text            = settings.Telephone;
     tb_unitName.Text       = settings.AuthUnitChs;
     tb_unitNameEng.Text    = settings.AuthUnitEng;
     tb_zipcode.Text        = settings.Zipcode;
     this.btn_apply.Enabled = false;
 }
示例#2
0
        public frm_main(Users user)
        {
            InitializeComponent();
            InitLicenseList();

            this.Text = ConfigurationManager.AppSettings["appName"];
            _Commands = new LMSCommands();
            _Commands.LicenseCommands.New              = new Command(components); // We pass in components from Form so the command gets disposed automatically when form is disposed
            _Commands.LicenseCommands.New.Executed    += NewLicenseExecuted;
            _Commands.LicenseCommands.Cancel           = new Command(components);
            _Commands.LicenseCommands.Cancel.Executed += CancelLicenseExecuted;
            //_Commands.LicenseCommands.Save = new Command(components);
            //_Commands.LicenseCommands.Save.Executed += SaveClientExecuted;
            btn_newLicense.Command = _Commands.LicenseCommands.New;

            _Commands.LicenseCommands.Save                  = new Command(components);
            _Commands.LicenseCommands.Save.Executed        += SaveLicenseExecuted;
            _Commands.SearchDialogCommands.Open             = new Command(components);
            _Commands.SearchDialogCommands.Open.Executed   += CertificationSearchExcuted;
            _Commands.SearchDialogCommands.Cancel           = new Command(components);
            _Commands.SearchDialogCommands.Cancel.Executed += CancelSearchDialogExecuted;
            tile_certManage.Command = _Commands.SearchDialogCommands.Open;
            lb_indexTitle.Text     += user.Realname;
            lb_username.Text        = user.Username;
            lb_role.Text            = user.RoleName;
            currentUser             = user;
            if (user.RoleName.IndexOf("管理员") >= 0)
            {
                pictureBox1.Image = Properties.Resources.admin;
            }
            else
            {
                pictureBox1.Image = Properties.Resources.normal;
            }
            metroToolbar1.Location   = new Point((this.Width - metroToolbar1.Width) / 2, metroToolbar1.Parent.Height - metroToolbar1.Height - 1);
            metroTilePanel1.Location = new Point((this.Width - metroTilePanel1.Width) / 2, (this.Height - metroTilePanel1.Height) / 2);

            settingBll     = new SettingBLL();
            defaultSetting = settingBll.GetDefaultSetting();

            roleBll = new RoleBLL();
            role    = roleBll.GetRoleById(currentUser.RoleId);
            if (defaultSetting == null)
            {
                if (role.AdminFlag == 1)
                {
                    if (DialogResult.OK == MessageBoxEx.Show("未配置系统全局设定,请配置全局设定", "全局设定未配置", MessageBoxButtons.OK))
                    {
                        new frm_globalSetting().ShowDialog();
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    if (DialogResult.OK == MessageBoxEx.Show("未配置系统全局设定,请联系管理员配置全局设定", "全局设定未配置", MessageBoxButtons.OK))
                    {
                        this.Close();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }