Esempio n. 1
0
        public static ResponseStatus ListByRole(string inRole)
        {
            ResponseStatus response = new ResponseStatus();
            var            list     = FCMRoleScreen.List(inRole);

            response.Contents = list;

            return(response);
        }
Esempio n. 2
0
        /// <summary>
        /// Get List of screens of user
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static List <CodeValue> GetListScreensForUser(string userID)
        {
            List <CodeValue> list = new List <CodeValue>();

            // Retrieve list of roles for user
            var listOfRoles = FCMUserRole.ListRoleForUser(userID);

            foreach (var role in listOfRoles)
            {
                // get list of screen for role
                //
                var listOfScreen = FCMRoleScreen.List(role.FK_Role);

                foreach (var cvScreen in listOfScreen)
                {
                    var screenAsCodeValue = new CodeValue();
                    screenAsCodeValue.ID          = cvScreen.FKScreenCode;
                    screenAsCodeValue.Description = CodeValue.GetCodeValueDescription(
                        FCMConstant.CodeTypeString.SCREENCODE, cvScreen.FKScreenCode);

                    bool found = false;
                    foreach (var alreadyInListScreen in list)
                    {
                        if (cvScreen.FKScreenCode == alreadyInListScreen.ID)
                        {
                            found = true;
                            break;
                        }
                    }

                    if (found)
                    {
                        continue;
                    }

                    list.Add(screenAsCodeValue);
                }
            }

            return(list);
        }