public bool Read() { try { Data.USUARIO account = Connection.LindaSonrisaDB.USUARIO.First(user => user.NOMBRE == Username); Id = (int)account.ID; Username = account.NOMBRE; Password = account.CLAVE; IdSecretQuestion = (int)account.ID_PREGUNTA; AnswerSecretQuestion = account.RESP_PREGUNTA; return(true); } catch (Exception) { return(false); } }
public bool Create() { try { Data.USUARIO account = new Data.USUARIO(); account.ID = SequencerController.GetNextVal("SEQ_ID_USUARIO"); account.NOMBRE = Username; account.CLAVE = Password; account.ID_PREGUNTA = IdSecretQuestion; account.RESP_PREGUNTA = AnswerSecretQuestion; Connection.LindaSonrisaDB.USUARIO.Add(account); Connection.LindaSonrisaDB.SaveChanges(); return(true); } catch (Exception) { return(false); } }