Beispiel #1
0
        public MessageRespone Login(string user, string pwd, string centerid)
        {
            using (var db = new LiteDatabase(localdb))
            {
                var col = db.GetCollection <Center>("center");

                col.EnsureIndex(x => x._id);
                var data = col.Find(x => x._id == centerid).FirstOrDefault();

                MessageRespone result = new MessageRespone()
                {
                };

                if (data.LatestUser == user && data.LatestPass == pwd)
                {
                    result.Code    = "SUCCESS";
                    result.Message = "SUCCESS";
                }
                else
                {
                    result.Code    = "NOT MATCH";
                    result.Message = "NOT MATCH";
                }

                return(result);
            }
        }
Beispiel #2
0
        public MessageRespone Login(string user, string pass, string centerId)
        {
            var data = repoOnSite.Login(user, pass, centerId);

            var result = new MessageRespone
            {
                Code    = data.Code,
                Message = data.Message,
            };

            return(result);
        }