Beispiel #1
0
 private void logInToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         BCUtility.doLogin(this, bcApp);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception:");
     }
 }
Beispiel #2
0
 /// <summary>
 /// Handles the Click event of the changePasswordToolStripMenuItem control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!BCUtility.isLogin(bcApp))
     {
         if (!BCUtility.doLogin(this, bcApp))
         {
             return;
         }
     }
     openForm("ChangePwdForm");
 }
Beispiel #3
0
        /// <summary>
        /// Handles the FormClosing event of the BCMainForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="FormClosingEventArgs"/> instance containing the event data.</param>
        private void BCMainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            //TODO 確認Authority
            //if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_CLOSE_MASTER_PC))
            //{
            //    //e.Cancel = true;
            //    //return;
            //}

            //1.初步詢問是否要關閉OHBC
            DialogResult confirmResult = MessageBox.Show(this, "Do you want to close OHTC?",
                                                         BCApplication.getMessageString("CONFIRM"), MessageBoxButtons.YesNo);

            recordAction("Do you want to close OHTC?", confirmResult.ToString());
            if (confirmResult != System.Windows.Forms.DialogResult.Yes)
            {
                e.Cancel = true;
                return;
            }

            if (!SCUtility.isMatche(bcApp.SCApplication.BC_ID, "ASE_LOOP"))
            {
                if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_CLOSE_SYSTEM, true))
                {
                    e.Cancel = true;
                    recordAction("Close Master PC, Authority Check...", "Failed !!");
                    return;
                }
            }
            recordAction("Close Master PC, Authority Check...", "Success !!");

            if (e.Cancel == false)
            {
                try
                {
                    ProgressBarDialog progress = new ProgressBarDialog(bcApp);
                    System.Threading.ThreadPool.QueueUserWorkItem(
                        new System.Threading.WaitCallback(doStopConnection), progress);
                    if (progress != null && !progress.IsDisposed)
                    {
                        progress.ShowDialog();
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex, "Exception");
                }
            }
        }
        private void registerFunction()
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }
            UASUSRGRP selectUserGroup = getSelectedRowToTextBox();

            if (selectUserGroup == null)
            {
                return;
            }

            FuncCodePopupForm funcCodePopupForm = new FuncCodePopupForm();

            funcCodePopupForm.setUserGroup(selectUserGroup.USER_GRP);
            DialogResult  result             = funcCodePopupForm.ShowDialog(this);
            List <UASFNC> selectFuncCodeList = new List <UASFNC>();

            if (result == DialogResult.OK)
            {
                selectFuncCodeList = funcCodePopupForm.getSelectFunctionCodeList();
                funcCodePopupForm.Dispose();
            }
            else
            {
                funcCodePopupForm.Dispose();
                return;
            }
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }

            List <string> funcCodes       = selectFuncCodeList.Select(o => o.FUNC_CODE.Trim()).ToList();
            Boolean       registerSuccess = bcApp.SCApplication.UserBLL.registerUserFunc(selectUserGroup.USER_GRP, funcCodes);

            if (registerSuccess)
            {
                //MessageBox.Show(this, BCApplication.getMessageString("REGISTER_SUCCESS"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("REGISTER_SUCCESS"));
                Refresh();
            }
            else
            {
                //MessageBox.Show(this, BCApplication.getMessageString("REGISTER_FAILED"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("REGISTER_FAILED"));
            }
        }
Beispiel #5
0
 /// <summary>
 /// Handles the Click event of the uASToolStripMenuItem control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void uASToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
     {
         return;
     }
     if (uasMainForm == null || uasMainForm.IsDisposed)
     {
         uasMainForm = new UASMainForm();
         uasMainForm.Show();
         uasMainForm.Focus();
     }
     else
     {
         uasMainForm.rework();
         uasMainForm.Focus();
     }
 }
Beispiel #6
0
        private void DeleteBtn_Click(object sender, EventArgs e)
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }
            UASFNC selectFuncCode = getSelectedRowToTextBox();

            if (selectFuncCode == null)
            {
                return;
            }
            if (BCFUtility.isMatche(BCAppConstants.FUNC_USER_MANAGEMENT, selectFuncCode.FUNC_CODE))
            {
                return;
            }
            var confirmResult = MessageBox.Show(this, "Are you sure to delete this item ?",
                                                "Confirm Delete!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult != DialogResult.Yes)
            {
                return;
            }

            Boolean deleteSuccess =
                bcApp.SCApplication.UserBLL.deleteFunctionCodeByCode(selectFuncCode.FUNC_CODE);

            if (deleteSuccess)
            {
                //MessageBox.Show(this, BCApplication.getMessageString("DELETE_SUCCESS"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("DELETE_SUCCESS"));
                Refresh();
            }
            else
            {
                //MessageBox.Show(this, BCApplication.getMessageString("DELETE_FAILED"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("DELETE_FAILED"));
            }
        }
Beispiel #7
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }
            string user_id   = this.UserIDTbx.Text.Trim();
            string user_name = this.UserNameTbx.Text.Trim();
            string passwd    = this.PswdTbx.Text.Trim();
            string userGrp   = this.userGrpCbx.Text.Trim(); //A0.01
            //A0.03 Boolean isDisable = this.Disable_Y_RBtn.Checked;
            //A0.03 Boolean isPowerUser = this.Power_Y_RBtn.Checked;
            Boolean isDisable = false;   //A0.03

#pragma warning disable CS0219           // 已指派變數 'isPowerUser',但是從未使用過它的值。
            Boolean isPowerUser = false; //A0.03
#pragma warning restore CS0219           // 已指派變數 'isPowerUser',但是從未使用過它的值。

            if (!checkInputDataForAdd())
            {
                return;
            }

            Boolean createSuccess =
                bcApp.SCApplication.UserBLL.createUser(user_id, user_name, passwd, isDisable, userGrp, null, null);  //A0.01
            //A0.01    bcApp.SCApplication.UserBLL.createUser(user_id, user_name, passwd, isDisable, isPowerUser);
            if (createSuccess)
            {
                //MessageBox.Show(this, BCApplication.getMessageString("CREATE_SUCCESS"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("CREATE_SUCCESS"));
                Refresh();
            }
            else
            {
                //MessageBox.Show(this, BCApplication.getMessageString("CREATE_FAILED"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("CREATE_FAILED"));
            }
        }
Beispiel #8
0
        private void UpdBtn_Click(object sender, EventArgs e)
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }

            string  user_id     = this.UserIDTbx.Text.Trim();
            string  user_name   = this.UserNameTbx.Text.Trim();
            string  passwd      = this.PswdTbx.Text.Trim();
            string  user_grp    = this.userGrpCbx.Text.Trim(); //A0.01
            Boolean isDisable   = this.Disable_Y_RBtn.Checked;
            Boolean isPowerUser = this.Power_Y_RBtn.Checked;

            if (!checkInputDataForUpdate())
            {
                return;
            }

            Boolean updateSuccess =
                bcApp.SCApplication.UserBLL.updateUser(user_id, user_name, passwd, isDisable, user_grp, null, null);  //A0.01

            //A0.01     bcApp.SCApplication.UserBLL.updateUser(user_id, user_name, passwd, isDisable, isPowerUser);

            if (updateSuccess)
            {
                //MessageBox.Show(this, BCApplication.getMessageString("UPDATE_SUCCESS"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("UPDATE_SUCCESS"));
                Refresh();
            }
            else
            {
                //MessageBox.Show(this, BCApplication.getMessageString("UPDATE_FAILED"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("UPDATE_FAILED"));
            }
        }