public override void Fill(MySql.Data.MySqlClient.MySqlDataReader dr) { _ID = dr.GetInt32(db_ID); _Name = dr.GetString(db_Name); _Abbreviation = dr.GetString(db_Abbreviation); _RequiresRoom = dr.GetBoolean(db_RequiresRoom); _RequiresDays = dr.GetBoolean(db_RequiresDays); _RequiresTimes = dr.GetBoolean(db_RequiresTimes); }
protected Inschrijving GetInschrijvingFromDataReader(MySqlDataReader dataReader) { bool eetMee = dataReader.GetBoolean("eetMee"); bool betaald = dataReader.GetBoolean("betaald"); Inschrijving inschrijving = new Inschrijving { EetMee = eetMee, Betaald = betaald }; return inschrijving; }
public static PyObject DBColumnToPyObject(int index, ref MySqlDataReader reader) { Type type = reader.GetFieldType(index); switch (type.Name) { case "String": return new PyString(reader.GetString(index)); case "UInt32": case "Int32": case "UInt16": case "Int16": case "SByte": case "Byte": return new PyInt(reader.GetInt32(index)); case "UInt64": case "Int64": return new PyLongLong(reader.GetInt64(index)); case "Byte[]": return new PyBuffer((byte[])reader.GetValue(index)); case "Double": return new PyFloat(reader.GetDouble(index)); case "Decimal": return new PyFloat((double)reader.GetDecimal(index)); case "Boolean": return new PyBool(reader.GetBoolean(index)); default: Log.Error("Database", "Unhandled MySQL type " + type.Name); break; } return null; }
protected Genre GetGenreFromDataReader(MySqlDataReader dataReader) { string genreNaam = dataReader.GetString("genrenaam"); int genreId = dataReader.GetInt32("genre_id"); bool verslavend = dataReader.GetBoolean("verslavend"); Genre genre = new Genre { ID = genreId, Naam = genreNaam, Verslavend = verslavend }; return genre; }
public override void Fill(MySql.Data.MySqlClient.MySqlDataReader dr) { _ID = dr.GetInt32(db_ID); _InstructorID = dr.GetInt32(db_InstructorID); _SectionID = dr.GetInt32(db_SectionID); _IsPrimary = dr.GetBoolean(db_IsPrimary); _TeachingPercentage = dr.GetInt32(db_TeachingPercentage); _DateArchived = dr.GetDateTime(db_DateArchived); }
public ArrayList getTrips() { MySql.Data.MySqlClient.MySqlConnection conn; string myConnectionString = ConfigurationManager.ConnectionStrings["PhpMySqlRemoteDB"].ConnectionString; conn = new MySql.Data.MySqlClient.MySqlConnection(); try { conn.ConnectionString = myConnectionString; conn.Open(); ArrayList tripArray = new ArrayList(); MySql.Data.MySqlClient.MySqlDataReader mySQLReader = null; string sqlString = "SELECT * FROM Trips"; MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand(sqlString, conn); mySQLReader = cmd.ExecuteReader(); while (mySQLReader.Read()) { Trip t = new Trip(); t.TripID = mySQLReader.GetInt32(0); t.Username = mySQLReader.GetString(1); t.From_City_Country = mySQLReader.GetString(2); t.To_City_Country = mySQLReader.GetString(3); t.TransportationType = mySQLReader.GetString(4); t.OutboundTripDetails_Day = mySQLReader.GetDateTime(5); t.OutboundTripDetails_Time = mySQLReader.GetTimeSpan(6); t.OutboundTripDetails_Duration = mySQLReader.GetFloat(7); t.AddAReturnTrip = mySQLReader.GetBoolean(8); t.ReturnTripDetails_Day = mySQLReader.GetDateTime(9); t.ReturnTripDetails_Time = mySQLReader.GetTimeSpan(10); t.ReturnTripDetails_Duration = mySQLReader.GetFloat(11); t.AvailableWeight = mySQLReader.GetFloat(12); t.ExcludedCategories = mySQLReader.GetString(13); t.TripNote = mySQLReader.GetString(14); tripArray.Add(t); } return(tripArray); } catch (MySql.Data.MySqlClient.MySqlException ex) { throw ex; } finally { conn.Close(); } }
public Guild(MySqlDataReader reader, MySqlConnection con) { ID = reader.GetInt32("ID"); Name = reader.GetString("GuildName"); // _Password = (byte[])reader.GetValue("Password"); _Password = new byte[12]; AllowGuildWar = reader.GetBoolean("AllowGuildWar"); Message = reader.GetString("GuildMessage"); MessageCreateTime = reader.GetDateTime(8); MessageCreaterID = reader.GetInt32("CreaterID"); CreateTime = DateTime.Now;//read later GuildMoney = reader.GetInt64("GuildMoney"); Members = new List<GuildMember>(); ThreadLocker = new object(); GuildStore = new GuildStorage(this); Load(); }
public override void Fill(MySql.Data.MySqlClient.MySqlDataReader dr) { _ID = dr.GetInt32(db_ID); _Name = dr.GetString(db_Name); _IsAdmin = dr.GetBoolean(db_IsAdmin); _Sections = new RolePermission(dr.GetInt32(db_Sections)); _Courses = new RolePermission(dr.GetInt32(db_Courses)); _Buildings = new RolePermission(dr.GetInt32(db_Buildings)); _Campuses = new RolePermission(dr.GetInt32(db_Campuses)); _Roles = new RolePermission(dr.GetInt32(db_Roles)); _Users = new RolePermission(dr.GetInt32(db_Users)); _Departments = new RolePermission(dr.GetInt32(db_Departments)); _Instructors = new RolePermission(dr.GetInt32(db_Instructors)); _Days = new RolePermission(dr.GetInt32(db_Days)); _Rooms = new RolePermission(dr.GetInt32(db_Rooms)); _ScheduleTypes = new RolePermission(dr.GetInt32(db_ScheduleTypes)); _Spreadsheets = new RolePermission(dr.GetInt32(db_Spreadsheets)); }
public Guild(MySqlConnection con, MySqlDataReader reader) : this() { ID = reader.GetInt32("ID"); Name = reader.GetString("GuildName"); // _Password = (byte[])reader.GetValue("Password"); _Password = new byte[12]; AllowGuildWar = reader.GetBoolean("AllowGuildWar"); Message = reader.GetString("GuildMessage"); MessageCreateTime = reader.GetDateTime(8); CreateTime = DateTime.Now;//read later WorldCharacter creater; if (!CharacterManager.Instance.GetCharacterByID(reader.GetInt32("GuildMessageCreater"), out creater)) throw new InvalidOperationException("Can't find character which created guild message. Character ID: " + reader.GetInt32("GuildMessageCreater")); MessageCreater = creater; Load(); }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_parent_id = _reader["parent_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("parent_id") : 0; mc_parent_id = false; m_category_id = _reader["category_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("category_id") : 0; mc_category_id = false; m_nested_category_id = _reader["nested_category_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("nested_category_id") : 0; mc_nested_category_id = false; m_item_order = _reader["item_order"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("item_order") : 0; mc_item_order = false; m_in_search = _reader["in_search"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("in_search") : false; mc_in_search = false; m_map_key = _reader["map_key"].GetType() != typeof(System.DBNull) ? _reader.GetString("map_key") : ""; mc_map_key = false; }
private Client ReadClientData(MySqlDataReader reader) { Client client = new Client(); client.client_id = reader.GetInt32("client_id"); client.client_name = reader.GetString("client_name"); client.client_surname = reader.GetString("client_surname"); client.client_email = reader.GetString("client_email"); client.client_phone = !reader.IsDBNull(4) ? reader.GetString("client_phone") : null; client.client_birth_date = reader.GetDateTime("client_birth_date"); client.client_member_from = reader.GetDateTime("client_member_from"); client.client_member_to = !reader.IsDBNull(7) ? reader.GetDateTime("client_member_to") : DateTime.MinValue; client.client_street = !reader.IsDBNull(8) ? reader.GetString("client_street") : null; client.client_city = !reader.IsDBNull(9) ? reader.GetString("client_city") : null; client.client_zip = !reader.IsDBNull(10) ? reader.GetString("client_zip") : null; client.client_country = !reader.IsDBNull(11) ? reader.GetString("country") : null; client.client_isEmp = reader.GetBoolean("client_isEmp"); client.client_is_active = reader.GetBoolean("client_is_active"); client.client_login = reader.GetString("client_login"); client.client_pass_hash = reader.GetString("client_pass_hash"); client.client_last_act = !reader.IsDBNull(16) ? reader.GetDateTime("client_last_act") : DateTime.MinValue; return client; }
/// <summary> /// Fills the object using the datareader /// </summary> /// <param name="dr"></param> public void Fill(MySql.Data.MySqlClient.MySqlDataReader dr) { ID = dr.GetInt32("RoleID"); Title = dr.GetString("Title"); //IsAdmin = dr.GetBoolean("IsAdmin"); //IsTechnician = dr.GetBoolean("IsTechnician"); TicketsView = dr.GetBoolean("TicketsView"); TicketsComment = dr.GetBoolean("TicketsComment"); TicketsResolve = dr.GetBoolean("TicketsResolve"); TicketsOpen = dr.GetBoolean("TicketsOpen"); TicketsEdit = dr.GetBoolean("TicketsEdit"); AssetsView = dr.GetBoolean("AssetsView"); AssetsAdd = dr.GetBoolean("AssetsAdd"); AssetsEdit = dr.GetBoolean("AssetsEdit"); AssetsArchive = dr.GetBoolean("AssetsArchive"); UsersView = dr.GetBoolean("UsersView"); UsersAdd = dr.GetBoolean("UsersAdd"); UsersEdit = dr.GetBoolean("UsersEdit"); UsersDisable = dr.GetBoolean("UsersDisable"); RolesView = dr.GetBoolean("RolesView"); DeleteAsset = dr.GetBoolean("DeleteAsset"); }
public void updateBooleanValue(String tabela, String campo, OleDbCommand comandoTarget, MySqlDataReader reader, Int16 index, String campoId, Int32 valorId) { if (!reader.IsDBNull(index)) { comandoTarget.CommandText = "Update " + tabela + " set " + campo + "=" + reader.GetBoolean(index) + " where " + campoId + " = " + valorId ; comandoTarget.ExecuteNonQuery(); } }
public static bool? getBool(MySqlDataReader dr, string column) { int ordinal = dr.GetOrdinal(column); if (dr.IsDBNull(ordinal)) { return null; } else { return dr.GetBoolean(ordinal); } }
// // GetUserFromReader // A helper function that takes the current row from the MySqlDataReader // and hydrates a MembershiUser from the values. Called by the // MembershipUser.GetUser implementation. // private MembershipUser GetUserFromReader(MySqlDataReader reader) { object providerUserKey = new Guid(reader.GetValue(0).ToString()); string username = reader.IsDBNull(1) ? "" : reader.GetString(1); string email = reader.IsDBNull(2) ? "" : reader.GetString(2); string passwordQuestion = reader.IsDBNull(3) ? "" : reader.GetString(3); string comment = reader.IsDBNull(4) ? "" : reader.GetString(4); bool isApproved = reader.IsDBNull(5) ? false : reader.GetBoolean(5); bool isLockedOut = reader.IsDBNull(6) ? false : reader.GetBoolean(6); DateTime creationDate = reader.IsDBNull(7) ? DateTime.Now : reader.GetDateTime(7); DateTime lastLoginDate = reader.IsDBNull(8) ? DateTime.Now : reader.GetDateTime(8); DateTime lastActivityDate = reader.IsDBNull(9) ? DateTime.Now : reader.GetDateTime(9); DateTime lastPasswordChangedDate = reader.IsDBNull(10) ? DateTime.Now : reader.GetDateTime(10); DateTime lastLockedOutDate = reader.IsDBNull(11) ? DateTime.Now : reader.GetDateTime(11); return new MembershipUser( this.Name, username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate ); }
private static MembershipUser GetUserFromReader(MySqlDataReader reader) { int id_user = reader.GetInt32("id_user"); string username = reader.GetString("userName"); string email = reader.GetString("email"); bool isApproved = reader.GetBoolean("approved"); bool isLockedOut = reader.GetBoolean("locked"); DateTime createdDate = reader.GetDateTime("creationDate"); DateTime lastLoginDate = reader["lastLoginDate"] != DBNull.Value ? reader.GetDateTime("lastLoginDate") : DateTime.MinValue; DateTime lastActivityDate = reader["lastActivityDate"] != DBNull.Value ? reader.GetDateTime("lastActivityDate") : DateTime.MinValue; DateTime lastLockedDate = reader["lastLockedDate"] != DBNull.Value ? reader.GetDateTime("lastLockedDate") : DateTime.MinValue; DateTime lastPasswordChangedDate = reader["lastPasswordChangedDate"] != DBNull.Value ? reader.GetDateTime("lastPasswordChangedDate") : DateTime.MinValue; return new MembershipUser("PureMembershipProvider", username, null, email, null, null, isApproved, isLockedOut, createdDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedDate); //return new PureMembershipUser(id_user, username, email, isApproved, isLockedOut, // createdDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedDate); }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_parent_id = _reader["parent_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("parent_id") : 0; mc_parent_id = false; m_show_on_sitemap = _reader["show_on_sitemap"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_on_sitemap") : false; mc_show_on_sitemap = false; }
private static Game MapGame(MySqlDataReader dr) { var game = new Game { AwayTeam = new Team { Id = dr.GetInt32("awayTeamId"), }, GameTime = dr.GetDateTime("gameTime"), HomeTeam = new Team { Id = dr.GetInt32("homeTeamId") }, Id = dr.GetInt64("id"), IsGameOver = dr.GetBoolean("isGameOver"), Season = dr.GetInt32("season"), SeasonType = (SeasonType) dr.GetInt32("type"), Week = dr.GetInt32("week") }; if (dr["awayTeamPoints"] != DBNull.Value) { game.AwayTeamScore = dr.GetInt32("awayTeamPoints"); } if (dr["homeTeamPoints"] != DBNull.Value) { game.HomeTeamScore = dr.GetInt32("homeTeamPoints"); } if (dr["winningTeamId"] != DBNull.Value) { game.WinningTeamId = dr.GetInt32("winningTeamId"); } game.GameTime = game.GameTime.AddDays(ConfigSettings.GameTimeOffSetInDays); return game; }
protected Blocked_timeslot ProcessRow(MySqlDataReader Reader, Blocked_timeslot blockedTimeSlot) { blockedTimeSlot.Daytime_id = Reader.GetInt32(0); blockedTimeSlot.Hardblock = Reader.GetBoolean(1); return blockedTimeSlot; }
/// <summary> /// Reads note from reader, returns null on error. /// </summary> /// <param name="reader"></param> /// <returns></returns> private Note ReadNote(MySqlDataReader reader) { var note = new Note(); note.Id = reader.GetInt64("noteId"); note.Sender = reader.GetStringSafe("sender"); note.Receiver = reader.GetStringSafe("receiver"); note.Message = reader.GetStringSafe("message"); note.Time = reader.GetDateTimeSafe("time"); note.Read = reader.GetBoolean("read"); var split = note.Sender.Split('@'); if (split.Length != 2) return null; note.FromCharacterName = split[0]; note.FromServer = split[1]; return note; }
private Borrowing ReadBorrowingData(MySqlDataReader reader) { Borrowing b = new Borrowing(); b.borrowing_id = reader.GetInt32(0); b.borrowing_from = reader.GetDateTime(1); b.borrowing_to = reader.GetDateTime(2); b.borrowing_is_returned = reader.GetBoolean(3); b.client_id = reader.GetInt32(4); b.copy_id = reader.GetInt32(5); return b; }
private static League MapLeague(MySqlDataReader dr) { return new League { Created = dr.GetDateTime("created"), CreatorUserId = dr.GetInt64("creatorUserId"), CreatorUserName = dr.GetString("creatorUserName"), Id = dr.GetInt64("id"), IsActive = dr.GetBoolean("active"), Name = dr.GetString("name"), OwnerUserId = dr.GetInt64("ownerUserId"), OwnerUserName = dr.GetString("ownerUserName"), Sport = (SportType) dr.GetInt32("sportId") }; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_url = _reader["url"].GetType() != typeof(System.DBNull) ? _reader.GetString("url") : ""; mc_url = false; m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : ""; mc_proto_name = false; m_order_number = _reader["order_number"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("order_number") : 0; mc_order_number = false; m_show_gallery = _reader["show_gallery"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_gallery") : false; mc_show_gallery = false; m_show_map = _reader["show_map"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_map") : false; mc_show_map = false; m_show_in_anounce = _reader["show_in_anounce"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_in_anounce") : false; mc_show_in_anounce = false; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_fieldsets = _reader["fieldsets"].GetType() != typeof(System.DBNull) ? _reader.GetString("fieldsets") : ""; mc_fieldsets = false; m_announce_order = _reader["announce_order"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("announce_order") : 0; mc_announce_order = false; m_show_in_announce = _reader["show_in_announce"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_in_announce") : false; mc_show_in_announce = false; m_controller = _reader["controller"].GetType() != typeof(System.DBNull) ? _reader.GetString("controller") : ""; mc_controller = false; m_action = _reader["action"].GetType() != typeof(System.DBNull) ? _reader.GetString("action") : ""; mc_action = false; }
public void findAll() { computerQuery = new MySqlCommand(); computerQuery.Connection = db.Connection(); computerQuery.CommandText = "SELECT * FROM computer"; computerResult = computerQuery.ExecuteReader(); while (computerResult.Read()) { if (!computerResult.IsDBNull(0)) { idcomputer = computerResult.GetInt32(0); } if(!computerResult.IsDBNull(1)) { computerstate = computerResult.GetBoolean(1); } //if (!computerResult.IsDBNull(2)) //{ // computerpurchasedate = computerResult.GetDateTime(2); //} //else //{ // computerpurchasedate = null; //} computers.Add(new Computer { idcomputer = this.idcomputer , computerstate = this.computerstate /*, computerpurchasedate = this.computerpurchasedate*/}); } db.Close(); }
private MembershipUser GetUserFromReader(MySqlDataReader reader) { object providerUserKey = reader.GetInt32("userId"); string username = reader.GetString("name"); string email = null; if (!reader.IsDBNull(reader.GetOrdinal("Email"))) email = reader.GetString("Email"); string passwordQuestion = ""; if (!(reader.GetValue(reader.GetOrdinal("PasswordQuestion")) == DBNull.Value)) passwordQuestion = reader.GetString("PasswordQuestion"); string comment = ""; if (!(reader.GetValue(reader.GetOrdinal("Comment")) == DBNull.Value)) comment = reader.GetString("Comment"); bool isApproved = reader.GetBoolean("IsApproved"); bool isLockedOut = reader.GetBoolean("IsLockedOut"); DateTime creationDate = reader.GetDateTime("CreationDate"); DateTime lastLoginDate = new DateTime(); if (!(reader.GetValue(reader.GetOrdinal("LastLoginDate")) == DBNull.Value)) lastLoginDate = reader.GetDateTime("LastLoginDate"); DateTime lastActivityDate = reader.GetDateTime("LastActivityDate"); DateTime lastPasswordChangedDate = reader.GetDateTime("LastPasswordChangedDate"); DateTime lastLockedOutDate = new DateTime(); if (!(reader.GetValue(reader.GetOrdinal("LastLockedoutDate")) == DBNull.Value)) lastLockedOutDate = reader.GetDateTime("LastLockedoutDate"); MembershipUser u = new MembershipUser(Name, username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate); return u; }
private MembershipUser GetUserFromReader(MySqlDataReader reader) { object providerUserKey = reader.GetValue(0); string username = reader.GetString(1); string email = null; if (!reader.IsDBNull(2)) email = reader.GetString(2); string passwordQuestion = ""; if (!(reader.GetValue(3) == DBNull.Value)) passwordQuestion = reader.GetString(3); string comment = ""; if (!(reader.GetValue(4) == DBNull.Value)) comment = reader.GetString(4); bool isApproved = reader.GetBoolean(5); bool isLockedOut = reader.GetBoolean(6); DateTime creationDate = reader.GetDateTime(7); DateTime lastLoginDate = new DateTime(); if (!(reader.GetValue(8) == DBNull.Value)) { lastLoginDate = reader.GetDateTime(8); } DateTime lastActivityDate = reader.GetDateTime(9); DateTime lastPasswordChangedDate = reader.GetDateTime(10); DateTime lastLockedOutDate = new DateTime(); if (!(reader.GetValue(11) == DBNull.Value)) { lastLockedOutDate = reader.GetDateTime(11); } MembershipUser u = new MembershipUser(Name, username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate); return u; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_territory_id = _reader["territory_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("territory_id") : 0; mc_territory_id = false; m_cure_profiles = _reader["cure_profiles"].GetType() != typeof(System.DBNull) ? _reader.GetString("cure_profiles") : ""; mc_cure_profiles = false; m_ad_cure_profiles = _reader["ad_cure_profiles"].GetType() != typeof(System.DBNull) ? _reader.GetString("ad_cure_profiles") : ""; mc_ad_cure_profiles = false; m_health_factors = _reader["health_factors"].GetType() != typeof(System.DBNull) ? _reader.GetString("health_factors") : ""; mc_health_factors = false; m_is_recomended = _reader["is_recomended"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("is_recomended") : false; mc_is_recomended = false; m_coordinates = _reader["coordinates"].GetType() != typeof(System.DBNull) ? _reader.GetString("coordinates") : ""; mc_coordinates = false; m_noyayesgo = _reader["noyayesgo"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("noyayesgo") : false; mc_noyayesgo = false; m_is_published = _reader["is_published"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("is_published") : false; mc_is_published = false; }
/// <summary> /// Read server parameters from the standard database query column /// layout and construct and return a NWGameServer corresponding to the /// data in question. /// </summary> /// <param name="Reader">Supplies a reader containing the results of a /// query that correspond to the standard column set.</param> /// <returns>A NWGameServer object describing the current row.</returns> private NWGameServer LoadGameServerFromQuery(MySqlDataReader Reader) { NWGameServer Server = new NWGameServer(); Server.ExpansionsMask = Reader.GetUInt32(1); Server.BuildNumber = Reader.GetUInt32(2); Server.ModuleName = Reader.GetString(3); Server.ServerName = Reader.GetString(4); Server.ActivePlayerCount = Reader.GetUInt32(5); Server.MaximumPlayerCount = Reader.GetUInt32(6); Server.LocalVault = Reader.GetBoolean(7); Server.LastHeartbeat = Reader.GetDateTime(8); Server.ServerAddress = Reader.GetString(9); Server.Online = Reader.GetBoolean(10); Server.PrivateServer = Reader.GetBoolean(11); Server.ModuleDescription = Reader.GetString(12); Server.ModuleUrl = Reader.GetString(13); Server.GameType = Reader.GetUInt32(14); Server.MinimumLevel = Reader.GetUInt32(15); Server.MaximumLevel = Reader.GetUInt32(16); Server.PVPLevel = Reader.GetUInt32(17); Server.PlayerPause = Reader.GetBoolean(18); Server.OnePartyOnly = Reader.GetBoolean(19); Server.ELCEnforced = Reader.GetBoolean(20); Server.ILREnforced = Reader.GetBoolean(21); Server.PWCUrl = Reader.GetString(22); Server.ServerDescription = Reader.GetString(23); return Server; }
public void findAll() { db = new Database(); persons.Clear(); personQuery = new MySqlCommand(); personQuery.Connection = db.Connection(); personQuery.CommandText = "SELECT * FROM person ORDER BY personname ASC"; personResult = personQuery.ExecuteReader(); while (personResult.Read()) { if (!personResult.IsDBNull(0)) { idperson = personResult.GetInt32(0); } if (!personResult.IsDBNull(1)) { personname = personResult.GetString(1); } if (!personResult.IsDBNull(2)) { personemail = personResult.GetString(2); } else { personemail = null; } if (!personResult.IsDBNull(3)) { personstate = personResult.GetBoolean(3); } persons.Add(new Person { idperson = this.idperson, personname = this.personname, personemail = this.personemail, personstate = this.personstate }); } db.Close(); }
private static LeagueMember MapLeagueMember(MySqlDataReader dr) { return new LeagueMember { Id = dr.GetInt64("id"), IsActive = dr.GetBoolean("active"), Joined = dr.GetDateTime("joined"), LeagueId = dr.GetInt64("leagueId"), UserId = dr.GetInt64("userId"), UserName = dr.GetString("userName") }; }
private void Load(MySqlDataReader reader) { CharacterID = reader.GetInt32("ID"); RegisterDate = reader.GetDateTime("RegisterDate"); IsChatBlocked = reader.GetBoolean("ChatBlock"); Rank = (GuildAcademyRank)reader.GetByte("Rank"); }
public void findByPersonnameAndPersonemail() { db = new Database(); personQuery = new MySqlCommand(); personQuery.Connection = db.Connection(); personQuery.CommandText = "SELECT * FROM person WHERE personname = @Name AND personemail = @Email"; personQuery.Prepare(); personQuery.Parameters.AddWithValue("@Name", personname); personQuery.Parameters.AddWithValue("@Email", personemail); personResult = personQuery.ExecuteReader(); while (personResult.Read()) { if (!personResult.IsDBNull(0)) { idperson = personResult.GetInt32(0); } if (!personResult.IsDBNull(1)) { personname = personResult.GetString(1); } if (!personResult.IsDBNull(2)) { personemail = personResult.GetString(2); } else { personemail = null; } if (!personResult.IsDBNull(3)) { personstate = personResult.GetBoolean(3); } } db.Close(); }
private TrackingEntry readEntry(MySqlDataReader reader) { TrackingEntry currentEntry = new TrackingEntry(); currentEntry.entryID = reader.GetInt32(0); currentEntry.taggerID = reader.GetInt32(1); currentEntry.type = reader.GetChar(2); currentEntry.isTagged = reader.GetBoolean(3); currentEntry.taggerName = reader.GetString(4); currentEntry.entryDate = ((DateTime)reader.GetMySqlDateTime(5)).ToString("yyyy-MM-dd HH:mm:ss"); if (reader.IsDBNull(6)) currentEntry.tagNumber = -1; else currentEntry.tagNumber = reader.GetInt32(6); currentEntry.species = reader.GetString(7); if (reader.IsDBNull(8)) currentEntry.city = ""; else currentEntry.city = reader.GetString(8); if (reader.IsDBNull(9)) currentEntry.state = ""; else currentEntry.state = reader.GetString(9); if (reader.IsDBNull(10)) currentEntry.country = ""; else currentEntry.country = reader.GetString(10); if (reader.IsDBNull(11)) currentEntry.longitude = ""; else currentEntry.longitude = reader.GetString(11); if (reader.IsDBNull(12)) currentEntry.latitude = ""; else currentEntry.latitude = reader.GetString(12); if (reader.IsDBNull(13)) currentEntry.temperature = ""; else currentEntry.temperature = reader.GetString(13); if (reader.IsDBNull(14)) currentEntry.precipitation = ""; else currentEntry.precipitation = reader.GetString(14); if (reader.IsDBNull(15)) currentEntry.windSpeed = ""; else currentEntry.windSpeed = reader.GetString(15); if (reader.IsDBNull(16)) currentEntry.windDirection = ""; else currentEntry.windDirection = reader.GetString(16); return currentEntry; }
private bool[] constructAttendance(MySqlDataReader attendanceReader) { bool[] attendanceArray = new bool[5]; attendanceArray[0] = attendanceReader.GetBoolean("Monday"); attendanceArray[1] = attendanceReader.GetBoolean("Tuesday"); attendanceArray[2] = attendanceReader.GetBoolean("Wednesday"); attendanceArray[3] = attendanceReader.GetBoolean("Thursday"); attendanceArray[4] = attendanceReader.GetBoolean("Friday"); return attendanceArray; }