// public async Task<List<Customer>> GetAllCustomers()
        // {

        //    // var r1 = await GetObjects<Address>("NetmeraUser");

        //     return await GetObjects<Customer>("Customers");

        //}


        public async Task <ApiResponse <List <Surveyor> > > Login(string login, string password)
        {
            NetmeraService service = new NetmeraService("Surveyors");

            service.whereEqual("Username", login);
            service.whereEqual("Password", Helpers.Sha1(password));


            var surveyors = await SearchObjects <Surveyor>(service);

            if (surveyors.IsSuccess && surveyors.Data.Any())
            {
                return(surveyors);
            }
            else
            {
                if (string.IsNullOrEmpty(surveyors.Message))
                {
                    surveyors.Message = "Wrong username or password";
                }

                surveyors.IsSuccess = false;

                return(surveyors);
            }
        }
예제 #2
0
        public async Task <HuntersWP.ServiceReference.LoginReply> Login(string login, string password)
        {
            var reply = await new MyServiceClient().Login(login, Helpers.Sha1(password));

            if (!reply.IsSuccess)
            {
                if (string.IsNullOrEmpty(reply.Data))
                {
                    reply.Data = "Wrong username or password";
                }
            }

            return(reply);
        }