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; }
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 void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_entity_id = _reader["entity_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("entity_id") : 0; mc_entity_id = false; m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : ""; mc_proto_name = false; m_url = _reader["url"].GetType() != typeof(System.DBNull) ? _reader.GetString("url") : ""; mc_url = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_keywords = _reader["keywords"].GetType() != typeof(System.DBNull) ? _reader.GetString("keywords") : ""; mc_keywords = false; m_description = _reader["description"].GetType() != typeof(System.DBNull) ? _reader.GetString("description") : ""; mc_description = false; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_entity_id = _reader["entity_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("entity_id") : 0; mc_entity_id = false; m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : ""; mc_proto_name = false; m_field_id = _reader["field_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("field_id") : 0; mc_field_id = false; m_field_value = _reader["field_value"].GetType() != typeof(System.DBNull) ? _reader.GetString("field_value") : ""; mc_field_value = false; }
private static UserRecord MapUserRecord(MySqlDataReader dr) { var record = new UserRecord(); record.Id = dr.GetInt64("id"); record.LastUpdated = dr.GetDateTime("lastUpdated"); record.Losses = dr.GetInt32("losses"); record.RecordType = (RecordType)dr.GetInt32("type"); record.Ties = dr.GetInt32("ties"); record.UserId = dr.GetInt64("userId"); record.UserName = dr.GetString("userName"); record.Wins = dr.GetInt32("wins"); if (!dr.IsDBNull(dr.GetOrdinal("season"))) { record.Season = dr.GetInt32("season"); } if (!dr.IsDBNull(dr.GetOrdinal("seasonType"))) { record.SeasonType = (SeasonType) dr.GetInt32("seasonType"); } if (!dr.IsDBNull(dr.GetOrdinal("week"))) { record.Week = dr.GetInt32("week"); } return record; }
public void setProperty(MySqlDataReader reader) { this._Name = reader.GetString(reader.GetOrdinal("Name")); this._Engine = reader.GetString(reader.GetOrdinal("Engine")); this._Version = reader.GetInt64(reader.GetOrdinal("Version")); this._Row_format = reader.GetString(reader.GetOrdinal("Row_format")); if (!reader.IsDBNull(reader.GetOrdinal("Rows"))) { this._Rows = reader.GetInt64(reader.GetOrdinal("Rows")); } this._Avg_row_length = reader.GetInt64(reader.GetOrdinal("Avg_row_length")); this._Data_length = reader.GetInt64(reader.GetOrdinal("Data_length")); this._Max_data_length = reader.GetInt64(reader.GetOrdinal("Max_data_length")); this._Index_length = reader.GetInt64(reader.GetOrdinal("Index_length")); this._Data_free = reader.GetInt64(reader.GetOrdinal("Data_free")); if (!reader.IsDBNull(reader.GetOrdinal("Auto_increment"))) { this._Auto_increment = reader.GetInt64(reader.GetOrdinal("Auto_increment")); } if (!reader.IsDBNull(reader.GetOrdinal("Create_time"))) { this._Create_time = reader.GetDateTime(reader.GetOrdinal("Create_time")); } if (!reader.IsDBNull(reader.GetOrdinal("Update_time"))) { this._Update_time = reader.GetDateTime(reader.GetOrdinal("Update_time")); } if (!reader.IsDBNull(reader.GetOrdinal("Check_time"))) { this._Check_time = reader.GetDateTime(reader.GetOrdinal("Check_time")); } this._Collation = reader.GetString(reader.GetOrdinal("Collation")); if (!reader.IsDBNull(reader.GetOrdinal("Checksum"))) { this._Checksum = reader.GetInt64(reader.GetOrdinal("Checksum")); } this._Create_options = reader.GetString(reader.GetOrdinal("Create_options")); this._Comment = reader.GetString(reader.GetOrdinal("Comment")); }
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_gender_id = _reader["gender_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("gender_id") : 0; mc_gender_id = false; m_css_class = _reader["css_class"].GetType() != typeof(System.DBNull) ? _reader.GetString("css_class") : ""; mc_css_class = false; m_item_order = _reader["item_order"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("item_order") : 0; mc_item_order = 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 LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_icd_code = _reader["icd_code"].GetType() != typeof(System.DBNull) ? _reader.GetString("icd_code") : ""; mc_icd_code = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_international_title = _reader["international_title"].GetType() != typeof(System.DBNull) ? _reader.GetString("international_title") : ""; mc_international_title = false; m_profile_id = _reader["profile_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("profile_id") : 0; mc_profile_id = 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_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; }
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_fieldset_id = _reader["fieldset_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("fieldset_id") : 0; mc_fieldset_id = false; m_field_id = _reader["field_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("field_id") : 0; mc_field_id = false; m_order_number = _reader["order_number"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("order_number") : 0; mc_order_number = false; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_parent_id = _reader["parent_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("parent_id") : 0; mc_parent_id = false; m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : ""; mc_title = false; m_publish_date = _reader["publish_date"].GetType() != typeof(System.DBNull) ? _reader.GetDateTime("publish_date") : DateTime.MinValue; mc_publish_date = false; m_html = _reader["html"].GetType() != typeof(System.DBNull) ? _reader.GetString("html") : ""; mc_html = false; m_alias = _reader["alias"].GetType() != typeof(System.DBNull) ? _reader.GetString("alias") : ""; mc_alias = false; }
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 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") }; }
private static LeagueInvitation MapInvitation(MySqlDataReader dr) { var invite = new LeagueInvitation { Created = dr.GetDateTime("created"), Email = dr.GetString("email"), Id = dr.GetInt64("id"), InvitationToken = dr.GetString("inviteToken"), LeagueId = dr.GetInt64("leagueId"), SentByUserId = dr.GetInt64("sentByUserId"), Status = (InviteStatus) dr.GetInt32("status") }; var userIdOrdinal = dr.GetOrdinal("userId"); var inviteSentOnOrdinal = dr.GetOrdinal("inviteSentOn"); var acceptedOnOrdinal = dr.GetOrdinal("acceptedOn"); if (!dr.IsDBNull(userIdOrdinal)) { invite.UserId = dr.GetInt64("userId"); } if (!dr.IsDBNull(inviteSentOnOrdinal)) { invite.InviteSentOn = dr.GetDateTime("inviteSentOn"); } if (!dr.IsDBNull(acceptedOnOrdinal)) { invite.AcceptedOn = dr.GetDateTime("acceptedOn"); } return invite; }
private static UserPick MapUserPick(MySqlDataReader dr) { var pick = new UserPick { GameId = dr.GetInt64("gameId"), Id = dr.GetInt64("id"), OptionId = dr.GetInt64("gameOptionId"), OptionGroupId = dr.GetInt64("groupId"), OptionType = (GameOptionType) dr.GetInt32("type"), UserId = dr.GetInt64("userId") }; var outcomeOrdinal = dr.GetOrdinal("outcome"); if (!dr.IsDBNull(outcomeOrdinal)) { pick.Outcome = (OptionOutcome) dr.GetInt32(outcomeOrdinal); } return pick; }
private ShoppingCart BuildObject(MySqlDataReader reader) { if (!reader.Read()) return null; var cart = new ShoppingCart(); do { cart.Items.Add(new ShoppingCart.ShoppingCartItem { Product = new Product { Id = reader.GetInt64("ProductId"), Name = reader.GetString("Name"), Price = reader.GetDecimal("Price"), Description = reader.GetString("Description"), }, Quantity = reader.GetInt32("Quantity"), }); } while (reader.Read()); return cart; }
private void RecordUserData() { try { String userData = this.username.Text; String pass = this.password.Password; String role = ""; if (this.user.IsChecked == true) { role = "user"; } else { role = "admin"; } String sqlInsert = "INSERT user (username, password, role) VALUES(@username, @password, @role)"; String sqlCheck = "SELECT COUNT(*) FROM user WHERE username=@username"; CheckStateDB(); System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(pass); byte[] hash = md5.ComputeHash(inputBytes); StringBuilder sb = new StringBuilder(); for (int i = 0; i < hash.Length; i++) { sb.Append(hash[i].ToString("X2")); } pass = sb.ToString().ToLower(); cmd = new MySqlCommand(sqlCheck, conn); cmd.Parameters.AddWithValue("@username", EncoderUTF(userData)); reader = cmd.ExecuteReader(); reader.Read(); if (reader.GetInt64(0) > 0) { reader.Close(); throw new Exception("exists"); } else { reader.Close(); cmd = new MySqlCommand(sqlInsert, conn); cmd.Parameters.AddWithValue("@username", EncoderUTF(userData)); cmd.Parameters.AddWithValue("@password", pass); cmd.Parameters.AddWithValue("@role", role); cmd.ExecuteNonQuery(); MessageBox.Show("บันทึกข้อมูลสมาชิกแล้ว", "สถานะการบันทึก"); ClearScreen(); } } catch (Exception er) { ErrorLogCreate(er); MessageBox.Show("มี username นี้แล้วหรือลืมใส่รหัสผ่าน", "สถานะการบันทึก"); } }
//getLast inserted id method public double getLastId() { double id = 0d; string sql; MySqlCommand comm = new MySqlCommand(); sql = "SELECT last_insert_id()"; comm.CommandText = sql; comm.Connection = this.conn; //this.reader = comm.ExecuteReader(); this.reader = this.execute(comm.CommandText); while (reader.Read()) { id = reader.GetInt64(0); } this.reader.Close(); return id; }
private static Option<Team> MapOption(MySqlDataReader dr) { var option = new Option<Team> { CutOff = dr.GetDateTime("cutOffTime"), GameId = dr.GetInt64("gameId"), GroupId = dr.GetInt64("groupId"), Id = dr.GetInt64("id"), Team = new Team { Id = dr.GetInt32("teamId") }, Type = (GameOptionType) dr.GetInt32("type") }; if (dr["value"] != DBNull.Value) { option.Value = dr.GetDecimal("value"); } if (dr["outcome"] != DBNull.Value) { option.Outcome = (OptionOutcome) dr.GetInt32("outcome"); option.IsWinner = option.Outcome.Value == OptionOutcome.Won; } option.CutOff = option.CutOff.AddDays(ConfigSettings.GameTimeOffSetInDays); option.IsPastCutOff = DateTime.UtcNow >= option.CutOff; return option; }
private static User MapUser(MySqlDataReader dr) { return new User { AuthToken = new AuthToken { Expiration = dr.GetDateTime("authTokenExpiration"), Token = dr.GetString("authToken"), UserId = dr.GetInt64("id"), UserName = dr.GetString("userName") }, Email = dr.GetString("email"), JoinedOn = dr.GetDateTime("joinedOn"), Id = dr.GetInt64("id"), PasswordHash = dr.GetString("password"), Salt = dr.GetString("salt"), Status = (UserStatus) dr.GetInt32("statusID"), UserName = dr.GetString("userName") }; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_email = _reader["email"].GetType() != typeof(System.DBNull) ? _reader.GetString("email") : ""; mc_email = false; m_firstname = _reader["firstname"].GetType() != typeof(System.DBNull) ? _reader.GetString("firstname") : ""; mc_firstname = false; m_lastname = _reader["lastname"].GetType() != typeof(System.DBNull) ? _reader.GetString("lastname") : ""; mc_lastname = false; m_secondname = _reader["secondname"].GetType() != typeof(System.DBNull) ? _reader.GetString("secondname") : ""; mc_secondname = false; m_role_id = _reader["role_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("role_id") : 0; mc_role_id = false; m_post = _reader["post"].GetType() != typeof(System.DBNull) ? _reader.GetString("post") : ""; mc_post = false; m_created = _reader["created"].GetType() != typeof(System.DBNull) ? _reader.GetDateTime("created") : DateTime.MinValue; mc_created = false; m_password = _reader["password"].GetType() != typeof(System.DBNull) ? _reader.GetString("password") : ""; mc_password = false; m_salt = _reader["salt"].GetType() != typeof(System.DBNull) ? !String.IsNullOrEmpty(_reader["salt"].ToString()) ? _reader.GetGuid("salt") : new System.Guid() : new System.Guid(); mc_salt = false; m_activation_guid = _reader["activation_guid"].GetType() != typeof(System.DBNull) ? !String.IsNullOrEmpty(_reader["activation_guid"].ToString()) ? _reader.GetGuid("activation_guid") : new System.Guid() : new System.Guid(); mc_activation_guid = false; m_lastlogin = _reader["lastlogin"].GetType() != typeof(System.DBNull) ? _reader.GetDateTime("lastlogin") : DateTime.MinValue; mc_lastlogin = false; m_rememberpass_guid = _reader["rememberpass_guid"].GetType() != typeof(System.DBNull) ? !String.IsNullOrEmpty(_reader["rememberpass_guid"].ToString()) ? _reader.GetGuid("rememberpass_guid") : new System.Guid() : new System.Guid(); mc_rememberpass_guid = false; }
public void ReadReviews() { int productID = product.id; int count = DbConnecter.instance.Count("productID", "review", "productID = " + productID + ";"); float anchorGap = 0.3f; float firstYMax = 0.75f; float lastYMax = 0; int maxRange = Mathf.Clamp(count - reviewUnits.Count, 0, count); int minRange = Mathf.Clamp(maxRange - oneLoadAmount, 0, maxRange); if (maxRange > 0) { string sql = "SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY(dateTime) DESC) AS id, email, productID, score, first, second, third, fourth, fifth FROM review WHERE productID = " + productID + ") newtable WHERE id <=" + maxRange + " AND id >" + minRange + "; "; /* * string sql = @"SELECT * * FROM ( * SELECT ROW_NUMBER() OVER(ORDER BY(dateTime) DESC) AS id, * * FROM review * WHERE productID = " + productID + * @") newtable * WHERE id <=" + maxRange + " AND id >" + minRange + "; "; */ MySql.Data.MySqlClient.MySqlDataReader reader = DbConnecter.instance.Reader(sql); while (reader.Read()) { Transform newReviewUnit = Instantiate(reviewUnit); newReviewUnit.SetParent(content.transform); RectTransform rectTransform = newReviewUnit.GetComponent <RectTransform>(); int reviewCount = reviewUnits.Count; float yMax = firstYMax - anchorGap * reviewCount; float yMin = yMax - anchorGap; lastYMax = yMin; rectTransform.anchorMax = new Vector2(1, yMax); rectTransform.anchorMin = new Vector2(0, yMin); rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; Review review = new Review(); review.id = (int)reader.GetInt64(0); review.email = reader.GetString(1); review.productID = reader.GetInt32(2); review.score = reader.GetInt32(3); review.first = reader.GetInt32(4); review.second = reader.GetInt32(5); review.third = reader.GetInt32(6); review.fourth = reader.GetInt32(7); review.fifth = reader.GetInt32(8); ReviewUnit reviewUnitInfo = newReviewUnit.GetComponent <ReviewUnit>(); reviewUnitInfo.Change(review, gameObject); reviewUnits.Add(reviewUnitInfo); } reader.Close(); DbConnecter.instance.CloseConnection(); } else { Debug.Log("불러올 리뷰가 없습니다"); } if (lastYMax < 0) { float contentSize = content.getInitialContentYSize() * (1 - (lastYMax)); content.ChangeSize(contentSize); } else { float contentSize = content.getInitialContentYSize(); content.ChangeSize(contentSize); } }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_entity_id = _reader["entity_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("entity_id") : 0; mc_entity_id = false; m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : ""; mc_proto_name = false; m_month = _reader["month"].GetType() != typeof(System.DBNull) ? _reader.GetByte("month") : (byte)0; mc_month = false; m_price = _reader["price"].GetType() != typeof(System.DBNull) ? _reader.GetFloat("price") : (double)0; mc_price = false; m_comment = _reader["comment"].GetType() != typeof(System.DBNull) ? _reader.GetString("comment") : ""; mc_comment = 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_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; }
public void LoadFromReader(MySqlDataReader _reader) { m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0; mc_id = false; m_word = _reader["word"].GetType() != typeof(System.DBNull) ? _reader.GetString("word") : ""; mc_word = false; m_translate = _reader["translate"].GetType() != typeof(System.DBNull) ? _reader.GetString("translate") : ""; mc_translate = false; m_explanation = _reader["explanation"].GetType() != typeof(System.DBNull) ? _reader.GetString("explanation") : ""; mc_explanation = false; }
/// <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; }
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; }
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; }
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_health_factors = _reader["health_factors"].GetType() != typeof(System.DBNull) ? _reader.GetString("health_factors") : ""; mc_health_factors = false; m_treatment_options = _reader["treatment_options"].GetType() != typeof(System.DBNull) ? _reader.GetString("treatment_options") : ""; mc_treatment_options = false; }