示例#1
0
        /*
         * public static ATS_ClientSettings_GetClientFromClientIDResult GetClientInfo(int ClientID)
         * {
         *  var db = new ClientsDataContext();
         *  var result = db.ATS_ClientSettings_GetClientFromClientID(ClientID).SingleOrDefault();
         *
         *  return result;
         * }
         */

        public static List <ScreeningONE.Models.Users.S1_Users_GetClientUsersResult> GetClientUsers(int clientid)
        {
            var db     = new UsersDataContext();
            var result = db.S1_Users_GetClientUsers(clientid);

            return(result.ToList());
        }
示例#2
0
        //Get a list of users for the specified client.  The list is formatted for use in a dropdown.
        public static List <SelectListItem> GetUsersFromClientForDropdown(int _ClientID)
        {
            List <SelectListItem> usersList = new List <SelectListItem>();

            var db     = new UsersDataContext();
            var result = db.S1_Users_GetClientUsers(_ClientID);

            foreach (var item in result)
            {
                if (!String.IsNullOrEmpty(item.UserName))
                {
                    SelectListItem listitem = new SelectListItem();
                    listitem.Value = item.UserID.ToString();
                    listitem.Text  = item.UserName;
                    usersList.Add(listitem);
                }
            }

            return(usersList);
        }