public HttpResponseMessage updateloginDetail(Login login)
        {
            try
            {
                return Request.CreateResponse(HttpStatusCode.OK, _repo.Updatelogin(login));
            }
            catch (Exception)
            {

                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
Ejemplo n.º 2
0
        public bool Updatelogin(Login LoginObj)
        {
            try
            {
                Login newlogin = _context.Logins.Where(x => x.LoginId == LoginObj.LoginId).FirstOrDefault();
                if (newlogin != null)
                {
                    newlogin = LoginObj;
                    _context.Entry(newlogin).State = System.Data.Entity.EntityState.Modified;
                    SaveContext();
                    return true;
                }
                return false;
            }
            catch (Exception)
            {

                throw;
            }
        }
Ejemplo n.º 3
0
        public Login Getlogin(Login obj)
        {
            try
            {
                return _context.Logins.Where(x => x.UserName == obj.UserName && x.Password == obj.Password).FirstOrDefault();
            }
            catch (Exception)
            {

                throw;
            }
        }
Ejemplo n.º 4
0
        public Login Addlogin(Login LoginObj)
        {
            try
            {
                LoginObj.CreatedDate = DateTime.Now;
                LoginObj.ModifiedDate = DateTime.Now;
                _context.Logins.Add(LoginObj);
                SaveContext();
                return LoginObj;
            }
            catch (Exception)
            {

                throw;
            }
        }