示例#1
0
文件: main.cs 项目: lokygb/FrontDesk
        private void MainForm_Load(object sender, System.EventArgs e)
        {
            //Register log event handler
            TestCenter.Logger.LogEnterred +=
                new TestLogger.LogEventHandler(Logger_LogEnterred);

            //Grab the center
            m_testcenter = TestCenter.GetInstance();

            //Init the image list
            lstMessages.SmallImageList = new ImageList();
            lstMessages.SmallImageList.Images.Add(new Bitmap("error.bmp"));
            lstMessages.SmallImageList.Images.Add(new Bitmap("info.bmp"));
            lstMessages.SmallImageList.Images.Add(new Bitmap("warning.bmp"));

            UpdateStatus();
        }
示例#2
0
 private void cmdLogin_Click(object sender, System.EventArgs e)
 {
     if (txtUsername.Text == "" || txtPassword.Text == "")
     {
         FormError("Please enter a username and password");
     }
     else
     {
         if (!TestCenter.GetInstance().Authenticate(txtUsername.Text, txtPassword.Text))
         {
             FormError("Either the username or password is incorrect");
         }
         else
         {
             DialogResult = DialogResult.OK;
         }
     }
 }