public async Task <TblUserPass> AddUserPass(TblUserPass userPass)
        {
            HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync("api/UserPassCore/AddUserPass", userPass);

            TblUserPass ans = await httpResponseMessage.Content.ReadAsAsync <TblUserPass>();

            return(ans);
        }
Beispiel #2
0
        public DtoTblUserPass(TblUserPass userPass, HttpStatusCode statusEffect)
        {
            id           = userPass.id;
            Username     = userPass.Username;
            Password     = userPass.Password;
            IsHelthApple = userPass.IsHelthApple;

            StatusEffect = statusEffect;
        }
        public async Task <bool> UpdateUserPass(TblUserPass userPass, int logId)
        {
            List <object> userPassAndLogId = new List <object>();

            userPassAndLogId.Add(userPass);
            userPassAndLogId.Add(logId);
            HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync("api/UserPassCore/UpdateUserPass", userPassAndLogId);

            bool ans = await httpResponseMessage.Content.ReadAsAsync <bool>();

            return(ans);
        }
        public IHttpActionResult AddUserPass(TblUserPass userPass)
        {
            var task = Task.Run(() => new UserPassService().AddUserPass(userPass));

            if (task.Wait(TimeSpan.FromSeconds(10)))
            {
                if (task.Result.id != -1)
                {
                    return(Ok(new DtoTblUserPass(task.Result, HttpStatusCode.OK)));
                }
                else
                {
                    return(Conflict());
                }
            }
            return(StatusCode(HttpStatusCode.RequestTimeout));
        }
        public IHttpActionResult UpdateUserPass(List <object> userPassLogId)
        {
            TblUserPass userPass = JsonConvert.DeserializeObject <TblUserPass>(userPassLogId[0].ToString());
            int         logId    = JsonConvert.DeserializeObject <int>(userPassLogId[1].ToString());
            var         task     = Task.Run(() => new UserPassService().UpdateUserPass(userPass, logId));

            if (task.Wait(TimeSpan.FromSeconds(10)))
            {
                if (task.Result)
                {
                    return(Ok(true));
                }
                else
                {
                    return(Conflict());
                }
            }
            return(StatusCode(HttpStatusCode.RequestTimeout));
        }
Beispiel #6
0
 public bool UpdateUserPass(TblUserPass userPass, int logId)
 {
     return(new MainProvider().Update(userPass, logId));
 }
Beispiel #7
0
 public TblUserPass AddUserPass(TblUserPass userPass)
 {
     return((TblUserPass) new MainProvider().Add(userPass));
 }
 public TblUserPass AddUserPass(TblUserPass userPass)
 {
     return(new UserPassRepo().AddUserPass(userPass));
 }
 public bool UpdateUserPass(TblUserPass userPass, int logId)
 {
     return(new UserPassRepo().UpdateUserPass(userPass, logId));
 }