Example #1
0
        private void UsrRytBtn_Click(object sender, EventArgs e)
        {
            ISecurity m_Security;

            m_Security   = new SecurityClass();
            InfoLbl.Text = "";
            Infolist.Items.Clear();
            Securitylist.Items.Clear();
            string strXML;
            string strModule;
            string strLeaf;
            long   lUserRyt;

            strXML    = XMTTxt.Text;
            strModule = ModuleTxt.Text;
            strLeaf   = LeafsecurityTxt.Text;
            if ((strXML == "") && (strModule == "") && (strLeaf == ""))
            {
                MessageBox.Show("Please the XML Module name,module section and leaf security node name");
            }
            else if (strXML == "")
            {
                MessageBox.Show("Please enter the XML module name");
            }
            else if (strModule == "")
            {
                MessageBox.Show("Please enter the module section");
            }
            else if (strLeaf == "")
            {
                MessageBox.Show("Please enter the leaf security node name");
            }
            else
            {
                lUserRyt = m_Security.get_UserRightInfo(strXML, strModule, strLeaf);
                if (lUserRyt == 1)
                {
                    InfoLbl.Text = "Have User Right Info";
                }
                else if (lUserRyt == 0)
                {
                    InfoLbl.Text = "Don't have user right Info";
                }
            }
        }
Example #2
0
        public void UpdateAddinCmdUI(int lCommandID, ref int pbEnable)
        {
            //TODO:  Add CAddinDotNet.UpdateAddinCmdUI implementation
            try
            {
                pbEnable = 1;

                string strFunctionName = string.Empty;

                for (int lIndex = 0; lIndex < m_MenuInfoArray.Count; lIndex++)
                {
                    for (int lCommandIndex = 0; lCommandIndex < m_MenuInfoArray[lIndex].m_CommandIDArray.Count; lCommandIndex++)
                    {
                        if (lCommandID == m_MenuInfoArray[lIndex].m_CommandIDArray[lCommandIndex])
                        {
                            strFunctionName = m_MenuInfoArray[lIndex].m_strFunctionName;

                            break;
                        }
                    }
                }

                ISecurity mSMPSecurity = new SecurityClass();
                int       lValue       = -1;

                if (("UsingISettingsInterface") == strFunctionName)
                {
                    string strCSharpModuleName    = "CSharp SecurityTest Module";
                    string strCSharpModuleSection = "Security Test Setup";
                    string strLeafNodeName        = "Show Settings";
                    try
                    {
                        lValue = mSMPSecurity.get_UserRightInfo(strCSharpModuleName, strCSharpModuleSection, strLeafNodeName);
                    }
                    catch (Exception)
                    {
                    }
                    pbEnable = lValue;
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.ToString());
            }
        }