コード例 #1
0
        }       //	loginComplete

        /// <summary>
        /// Update Info Window Columns.
        /// - add new Columns
        /// - remove columns
        /// - change dispay sequence
        /// </summary>
        /// <param name="AD_Client_ID">AD_Client_ID</param>
        /// <param name="columns">columns</param>
        /// <param name="sqlFrom">sqlFrom</param>
        /// <param name="sqlOrder">sqlOrder</param>
        /// <returns>true if you updated columns, sequence or sql From clause</returns>
        public bool UpdateInfoColumns(int AD_Client_ID, List <Info_Column> columns,
                                      StringBuilder sqlFrom, StringBuilder sqlOrder)
        {
            bool retValue = true;

            for (int i = 0; i < _validators.Count; i++)
            {
                ModelValidator validator = (ModelValidator)_validators[i];
                if (validator.GetAD_Client_ID() == 0 || validator.GetAD_Client_ID() == AD_Client_ID)
                {
                    try
                    {
                        bool bb = validator.UpdateInfoColumns(columns, sqlFrom, sqlOrder);
                        if (bb)
                        {
                            retValue = true;
                        }
                    }
                    catch (Exception e)
                    {
                        s_log.Warning(validator.ToString() + ": " + e);
                    }
                }
            }
            return(retValue);
        }       //	updateInfoColumns
コード例 #2
0
        }       //	get

        public String LoginComplete(int AD_Client_ID, int AD_Org_ID, int AD_Role_ID, int AD_User_ID)
        {
            for (int i = 0; i < _validators.Count; i++)
            {
                ModelValidator validator = (ModelValidator)_validators[i];
                if (AD_Client_ID == validator.GetAD_Client_ID())
                {
                    String error = validator.Login(AD_Org_ID, AD_Role_ID, AD_User_ID);
                    if (error != null && error.Length > 0)
                    {
                        return(error);
                    }
                }
            }
            return(null);
        }       //	loginComplete
コード例 #3
0
        /// <summary>
        /// Fire Model Change.
        ///	Call modelChange method of added validators
        /// </summary>
        /// <param name="po">persistent objects</param>
        /// <param name="changeType">ModalValidatorVariables.CHANGETYPE_*</param>
        /// <returns>error message or NULL for no veto</returns>
        public String FireModelChange(PO po, int changeType)
        {
            if (po == null || _modelChangeListeners.Count == 0)
            {
                return(null);
            }
            //
            String propertyName        = po.Get_TableName() + po.GetAD_Client_ID();
            List <ModelValidator> list = null;

            if (_modelChangeListeners.ContainsKey(propertyName))
            {
                list = new List <ModelValidator>();
                list = _modelChangeListeners[propertyName];
            }
            if (list == null || list.Count == 0)
            {
                return(null);
            }

            //
            for (int i = 0; i < list.Count; i++)
            {
                try
                {
                    ModelValidator validator = (ModelValidator)list[i];
                    if (validator.GetAD_Client_ID() == po.GetAD_Client_ID())
                    {
                        String error = validator.ModelChange(po, changeType);
                        if (error != null && error.Length > 0)
                        {
                            return(error);
                        }
                    }
                }
                catch (Exception e)
                {
                    String error = e.Message;
                    if (error == null)
                    {
                        error = e.ToString();
                    }
                    return(error);
                }
            }
            return(null);
        }
コード例 #4
0
        }       //	updateInfoColumns

        /// <summary>
        /// Fire Document Validation.
        /// Call docValidate method of added validators
        /// </summary>
        /// <param name="po">persistent objects</param>
        /// <param name="docTiming">see ModalValidatorVariables.DOCTIMING_ constants</param>
        /// <returns>error message or null</returns>
        public String FireDocValidate(PO po, int docTiming)
        {
            if (po == null || _docValidateListeners.Count == 0)
            {
                return(null);
            }
            //
            String propertyName        = po.Get_TableName() + po.GetAD_Client_ID();
            List <ModelValidator> list = null;

            if (_docValidateListeners.ContainsKey(propertyName))
            {
                list = new List <ModelValidator>();
                list = _docValidateListeners[propertyName];
            }
            if (list == null || list.Count == 0)
            {
                return(null);
            }

            //
            for (int i = 0; i < list.Count; i++)
            {
                ModelValidator validator = null;
                try
                {
                    validator = (ModelValidator)list[i];
                    if (validator.GetAD_Client_ID() == po.GetAD_Client_ID())
                    {
                        String error = validator.DocValidate(po, docTiming);
                        if (error != null && error.Length > 0)
                        {
                            return(error);
                        }
                    }
                }
                catch (Exception e)
                {
                    s_log.Log(Level.SEVERE, validator.ToString(), e);
                }
            }
            return(null);
        }