コード例 #1
0
        private void doneProcess_Click(object sender, EventArgs e)
        {
            if (_pd.insertRow(patient))
            {
                MessageBox.Show("Information Saved!");
                completeStatus = true;

                initPatientEntity();

                MdiParent.Close();

                MainMDIForm obj = new MainMDIForm(doctor);
                obj.getPatient(_pe);
                obj.Show();

                this.Hide();
            }
            else
            {
                MessageBox.Show("Unseccessful Attempt!");
                getAddress.Text  = "";
                getFullName.Text = "";
                getGender.Text   = "";
                return;
            }
        }
コード例 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            DialogResult dlgResult = MessageBox.Show("Are you sure you want to quit?", "Leave Archery Worx", MessageBoxButtons.YesNo);

            if (dlgResult == DialogResult.Yes)
            {
                MdiParent.Close();
            }
        }
コード例 #3
0
        /// <summary>
        /// Zatvara parent formu i tada otvara opet HELP.
        /// </summary>
        private void CloseOneOpenAnother()
        {
            MdiParent.Close();

            frmHELP frm = new frmHELP(eng, true);

            frm.Show();

            frm.TopMost = true;
            frm.Activate();
        }
コード例 #4
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are You Sure?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
     {
         MdiParent.Close();
     }
     else
     {
         txtName.Clear();
         txtPass.Clear();
         txtName.Focus();
     }
 }
コード例 #5
0
        private void goTreatment_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0)
            {
                return;
            }

            PatientEntity pe = dataGridView1.SelectedRows[0].DataBoundItem as PatientEntity;

            MessageBox.Show(pe.patientName + " is selected!");

            MdiParent.Close();

            MainMDIForm obj = new MainMDIForm(doctor);

            obj.getPatient(pe);
            obj.Show();

            this.Hide();
        }
コード例 #6
0
ファイル: Form2.cs プロジェクト: ShartepStudy/C_sharp
 private void exit1_Click(object sender, EventArgs e)
 {
     MdiParent.Close();
 }
コード例 #7
0
 /* CERRAR SESIÓN */
 private void btnCerrarSesion_Click(object sender, EventArgs e)
 {
     MdiParent.Close();
 }
コード例 #8
0
 private void btnCikis_Click(object sender, EventArgs e)
 {
     MdiParent.Close();
 }
コード例 #9
0
ファイル: FrmLogin.cs プロジェクト: cyrsis/RetailsPOS
        /// <summary>
        /// 執行登入動作
        /// </summary>
        /// <returns>登入成功回傳True,否則回傳False</returns>
        public bool RunLogin()
        {
            if (CheckField())
            {
                string UserID;
                string HashPwd;
                string encryptFormat;//加密格式設定
                string RoleName = "";

                encryptFormat = "SHA1";
                UserID        = txtUserID.Text;
                HashPwd       = My.MyMethod.HashEncryption(encryptFormat, txtPwd.Text);

                SIS.DBClass.DBClsLogin       DbLogin = new SIS.DBClass.DBClsLogin();
                SIS.DBClass.DBClsWinAPEvents WAE     = new SIS.DBClass.DBClsWinAPEvents();
                bool VerifyResult = false;
                try
                {
                    VerifyResult = DbLogin.VerifyPWD(UserID, HashPwd);
                    if (VerifyResult == false)
                    {
                        My.ErrorType errType = new My.ErrorType(My.MainErrorType.LoginError);
                        errType.loginError = new My.LoginError();
                        errType.loginError.AccountOrPasswordError = true;
                        throw new My.MyExceptionHandler(errType);
                    }
                }
                catch (My.MyExceptionHandler ex)
                {
                    MessageBox.Show(ex.Message, "MyExceptionHandler");
                    return(false);
                }

                if (VerifyResult)
                {
                    //MessageBox.Show("驗證成功");

                    //將登入結果寫入事件資料庫中
                    WAE.AddEventData(UserID, "資訊", "登入", "身分驗證成功");
                    RoleName = DbLogin.RoleIdToRoleName(UserID);

                    My.MyGlobal.GlobalUserID       = UserID;
                    My.MyGlobal.GlobalPassword     = txtPwd.Text;
                    My.MyGlobal.GlobalHashPassword = HashPwd;
                    My.MyGlobal.GlobalRoleName     = RoleName;

                    //執行登錄檔處理
                    if (RegistryProcess(UserID, RoleName))
                    {
                        //執行使用者授權動作
                        if (AuthorityProcess(UserID, RoleName))
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        MessageBox.Show("登錄檔作業失敗!!", "Registry作業", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return(false);
                    }
                }
                else
                {
                    //MessageBox.Show("驗證失敗");

                    My.MyGlobal.GlobalLoginErrorCounter += 1;

                    if (My.MyGlobal.GlobalLoginErrorCounter >= 3)
                    {
                        MessageBox.Show("[帳號]和[密碼]輸入錯誤超過三次!!,系統將強制關閉", "登入失敗", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        My.MyGlobal.GlobalSystemShutdown = true;
                        MdiParent.Close();
                        this.Close();
                    }


                    //將登入失敗的結果寫入事件資料庫中
                    WAE.AddEventData(UserID, "警告", "登入", "身分驗證失敗");

                    MessageBox.Show("[帳號]和[密碼]錯誤!!", "登入失敗", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }