Ejemplo n.º 1
0
        /// <summary>
        /// Get Fullname of user
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static string GetFullname(User user)
        {
            if (!TCCredentialsManager.Exists(user.Username))
            {
                throw new InvalidOperationException("User has not TC credentials");
            }
            var service = GetService(TCCredentialsManager.Get(user.Username));

            return(service.APP_UserDetail.Where(u => u.APP_Username == user.Username).First().APP_Fullname);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor that create access to user's Time Cockpit
        /// </summary>
        /// <param name="user"></param>
        public TCBrooker(User user)
        {
            if (!TCCredentialsManager.Exists(user.Username))
            {
                throw new InvalidOperationException("User has not TC credentials");
            }
            var service = TCUtils.GetService(TCCredentialsManager.Get(user.Username));

            TCService = service;
            this.user = user;
        }