private void AddBtn_Click(object sender, EventArgs e)
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }
            string user_group = this.UserGroupTbx.Text.Trim();

            if (!checkInputData())
            {
                return;
            }

            Boolean createSuccess = bcApp.SCApplication.UserBLL.addUserGroup(user_group);

            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"));
            }
        }
Пример #2
0
        private void UpdBtn_Click(object sender, EventArgs e)
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }
            string func_code = FuncCodeTBx.Text.Trim();
            string func_name = FuncNameTBx.Text.Trim();

            if (!checkInputData())
            {
                return;
            }

            Boolean updSuccess =
                bcApp.SCApplication.UserBLL.updateFunctionCodeByCode(func_code, func_name);

            if (updSuccess)
            {
                //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"));
            }
        }
        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"));
            }
        }
Пример #4
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"));
            }
        }
Пример #5
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"));
            }
        }
        //private void m_updateBtn_Click(object sender, EventArgs e)
        private void updateBtn()
        {
            string oldpasswd = SCUtility.Trim(m_oldPwdTxb.Text);
            string passwd    = SCUtility.Trim(m_newPwdTxb.Text);
            string verPasswd = SCUtility.Trim(m_newPwdVerTxb.Text);

            if (!bcApp.SCApplication.UserBLL.checkUserPassword(bcApp.LoginUserID, oldpasswd))                              //A0.01
            {                                                                                                              //A0.01
                MessageBox.Show(this, BCApplication.getMessageString("Please_Check_Old_Password"),                         //A0.01
                                BCApplication.getMessageString("INFO"), MessageBoxButtons.OK, MessageBoxIcon.Information); //A0.01
                return;                                                                                                    //A0.01
            }                                                                                                              //A0.01

            if (SCUtility.isEmpty(passwd) || SCUtility.isEmpty(verPasswd))
            {
                MessageBox.Show(this, BCApplication.getMessageString("Please_Input_New_Password"),
                                BCApplication.getMessageString("INFO"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (!SCUtility.isMatche(passwd, verPasswd))
            {
                MessageBox.Show(this, BCApplication.getMessageString("Please_Check_New_Password"),
                                BCApplication.getMessageString("INFO"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            Boolean updSuccess = bcApp.SCApplication.UserBLL.updatePassword(bcApp.LoginUserID, passwd);

            if (updSuccess)
            {
                //MessageBox.Show(this, BCApplication.getMessageString("UPDATE_SUCCESS"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("UPDATE_SUCCESS"));
            }
            else
            {
                //MessageBox.Show(this, BCApplication.getMessageString("UPDATE_FAILED"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("UPDATE_FAILED"));
            }
        }
Пример #7
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"));
            }
        }