예제 #1
0
        public string GetAllUserInfo(string userid)
        {
            var userlist = dbSet.FullClient.Queryable <RegUserInfo>().Where(e => e.delflag == false).Select((ui) =>
                                                                                                            new RegUserInfo()
            {
                id = ui.id, RegName = ui.RegName, RegTel = ui.RegTel
            }).ToList();

            return(DataSwitch.HttpPostList <RegUserInfo>(userlist));
        }
예제 #2
0
        public string GetVerlist(string path)
        {
            List <string> strlist = new List <string>();
            StreamReader  sr      = new StreamReader(path, Encoding.Default);
            String        line;

            while ((line = sr.ReadLine()) != null)
            {
                strlist.Add(line);
            }
            string msg = strlist[0];

            msg = msg.Substring(msg.IndexOf(','));
            string post = DataSwitch.HttpPostList <string>(strlist, msg);

            return(post);
        }
예제 #3
0
        public string InsertTable(string authlistjson, string userid)
        {
            List <UserAuth>  auths     = dbSet.GetList(u => u.UserID == userid.ToInt());
            List <Authority> authlist  = DataSwitch.JsonToList <Authority>(authlistjson);
            List <UserAuth>  userAuths = new List <UserAuth>();
            List <Authority> addauth   = new List <Authority>();

            foreach (var auth in authlist)
            {
                bool check = true;
                foreach (var au in auths)
                {
                    if (auth.id == au.AuthID)
                    {
                        check = false;
                    }
                }
                if (check)
                {
                    UserAuth userAuth = new UserAuth {
                        AuthID = auth.id, UserID = userid.ToInt()
                    };
                    userAuths.Add(userAuth);
                    addauth.Add(auth);
                }
            }
            if (userAuths.Count == 0)
            {
                return(DataSwitch.HttpPostList(addauth));
            }
            bool insert = dbSet.InsertRange(userAuths.ToArray());

            if (insert)
            {
                return(DataSwitch.HttpPostList(addauth));
            }
            return(DataSwitch.HttpPostMsg(General.strFail));
        }
예제 #4
0
        public string GetAllServerType(string userid)
        {
            var list = dbSet.GetList(s => s.delflag == false).ToList();

            return(DataSwitch.HttpPostList <ServerType>(list));
        }
예제 #5
0
        public string GetAllCustomInfo(string userid)
        {
            var list = dbSet.GetList(s => s.delflag == false).ToList();

            return(DataSwitch.HttpPostList <CustomInfo>(list));
        }
예제 #6
0
        public string GetDicbytype(string type)
        {
            List <Sysdic> cS = GetDicByTypeName(type);

            return(DataSwitch.HttpPostList <Sysdic>(cS));
        }
예제 #7
0
        public string GetOperAuthByTag(string authtype, int tag)
        {
            var authlist = dbSet.GetList(a => a.AuthTypeName == authtype & a.ParentID == tag);

            return(DataSwitch.HttpPostList <Authority>(authlist));
        }
예제 #8
0
        public string GetUserAuth(string userid, string portType)
        {
            var authlist = GetAuthoritiesClz(userid, portType);

            return(DataSwitch.HttpPostList <Authority>(authlist));
        }
예제 #9
0
        public string GetAllAuthority()
        {
            var authlist = GetAllAuth();

            return(DataSwitch.HttpPostList <Authority>(authlist));
        }