Пример #1
0
        /// <summary>
        /// Set AD_Process_ID.
        /// Check Role if process can be performed
        /// </summary>
        /// <param name="AD_Process_ID">process</param>
        public new void SetAD_Process_ID(int AD_Process_ID)
        {
            if (AD_Process_ID <= 0)
            {
                return;
            }
            Console.WriteLine(AD_Process_ID.ToString());
            int AD_Role_ID = GetCtx().GetAD_Role_ID();

            if (AD_Role_ID != 0)
            {
                MRole role   = MRole.Get(GetCtx(), AD_Role_ID);
                bool? access = role.GetProcessAccess(AD_Process_ID, AD_Role_ID);
                if (access == null)
                {
                    throw new Exception("Cannot access Process " + AD_Process_ID
                                        + " with Role: " + role.Get_Value("Name"));
                }
            }
            base.SetAD_Process_ID(AD_Process_ID);
        }