public Error Insert(AccountModel.Account _account) { string query = string.Format("INSERT INTO Account (UUID, Profile, CreatedAt, UpdatedAt) VALUES ('{0}', '{1}', '{2}', '{3}')", _account.accountID, _account.profile, ModelUtility.NewUtcNow(), ModelUtility.NewUtcNow()); return(SQLiteUtility.Execute(connection, query)); }
public AccountModel.Account QueryProfile(string _accountID, out Error _err) { _err = Error.OK; AccountModel.Account account = new AccountModel.Account(); string query = string.Format("SELECT * FROM Account WHERE UUID='{0}'", _accountID); _err = SQLiteUtility.Execute(connection, query, (_reader) => { while (_reader.Read()) { account.profile = _reader.GetString(_reader.GetOrdinal("Profile")); } }); return(account); }
private static void fetchProfile(Dictionary <string, Any> _params, Service.OnReplyCallback _onReply, Service.OnErrorCallback _onError) { MockReply reply = new MockReply(); try { string accountID = _params["accountID"].AsString; Error error; AccountModel.Account account = daoAccount.QueryProfile(accountID, out error); reply.data.Add("profile", account.profile); } catch (System.Exception e) { reply.code = -1; reply.message = e.Message; } _onReply(reply.ToJSON()); }
public Error Delete(AccountModel.Account _account) { string query = string.Format("DELETE FROM Account WHERE UUID='{0}'", _account.accountID); return(SQLiteUtility.Execute(connection, query)); }