Ejemplo n.º 1
0
        public override string GetCellData(string strColumnName, PwEntry pe)
        {
            if (strColumnName == null)
            {
                Debug.Assert(false);
                return(String.Empty);
            }

            if (strColumnName != m_vColNames[0])
            {
                return(String.Empty);
            }

            if (pe == null)
            {
                Debug.Assert(false);
                return(String.Empty);
            }


            if (!SAPLogonHandler.ValidateSAPGUIPath(m_config.SAPGUIPath))
            {
                return(Translatable.ColumnConfigFailure);
            }


            //detect SAP ID and SAP client
            string      strCellData = "";
            LogonColumn lc          = GetSAPLogonData(strColumnName, pe);

            if (lc.IsValid())
            {
                strCellData = FormattedCellData(lc);
            }
            else
            {
                if (lc.HasSAPID() || lc.HasSAPClient() || lc.HasSAPLanguage() || lc.HasSAPTransaction())
                {
                    strCellData = Translatable.ColumnInvalidData;
                }
                else
                {
                    strCellData = Translatable.ColumnNoneSAPData;
                }
            }

            return(strCellData);
        }
Ejemplo n.º 2
0
        //---------------------------------------------------------------------------------------------------
        // Private Methods
        //---------------------------------------------------------------------------------------------------
        private string FormattedCellData(LogonColumn entry)
        {
            string result = "";

            if (entry.HasSAPID() && m_config.DisSystemID)
            {
                result = result + entry.SAPID;
                if (entry.HasSAPClient() && m_config.DisClient)
                {
                    result = result + ":";
                }
            }

            if (entry.HasSAPClient() && m_config.DisClient)
            {
                result = result + entry.SAPClient;
            }

            if (entry.HasSAPLanguage() && m_config.DisLanguage)
            {
                result = result + " [" + entry.SAPLanguage + "]";
            }

            if (entry.HasSAPTransaction() && m_config.DisTx)
            {
                if ((entry.HasSAPID() && m_config.DisSystemID) ||
                    (entry.HasSAPClient() && m_config.DisClient) ||
                    (entry.HasSAPLanguage() && m_config.DisLanguage))
                {
                    result = result + " - ";
                }

                result = result + entry.SAPTransaction;
            }

            return(result);
        }