private void ClearAll_Click(object sender, EventArgs e) { memResult.Visible = false; memResult2.Visible = false; bookResult.Visible = false; memId.Clear(); BookID.Clear(); }
public override int GetHashCode() { int hash = 13; hash = (hash * 7) + BookID.GetHashCode(); hash = (hash * 7) + Name.GetHashCode(); return(hash); }
public override int GetHashCode() { var hashCode = -1696464566; hashCode = hashCode * -1521134295 + AuthorID.GetHashCode(); hashCode = hashCode * -1521134295 + BookID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + Birthday.GetHashCode(); return(hashCode); }
public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return(true); } if (obj == null || obj.ToString().Equals("{DisconnectedItem}")) { return(false); } var other = obj as BookTagViewModel; return(BookID.Equals(other.BookID) && TagID.Equals(other.TagID)); }
public override int GetHashCode() { int hash = 1; if (BookID.Length != 0) { hash ^= BookID.GetHashCode(); } if (Ticket.Length != 0) { hash ^= Ticket.GetHashCode(); } if (SetID != 0) { hash ^= SetID.GetHashCode(); } hash ^= lives_.GetHashCode(); if (WssProxy.Length != 0) { hash ^= WssProxy.GetHashCode(); } return(hash); }
public override int GetHashCode() { //Its upto UR logic to return a 32 Bit no that identifies UR Object. return(BookID.GetHashCode()); }
private void AddBook(object sender, EventArgs e) { Book book = new Book(); FileStream FS = new FileStream("Book.txt", FileMode.Append, FileAccess.Write); byte[] p; string Temp; //Write Field ID. book.set_FieldID(FieldID.Text); Temp = book.get_FieldID(); FS.WriteByte((byte)book.get_FieldID().Length); p = new byte[book.get_FieldID().Length]; for (int i = 0; i < book.get_FieldID().Length; i++) { p[i] = (byte)Temp[i]; } FS.Write(p, 0, book.get_FieldID().Length); //Write Book ID. if (book.set_BookID(BookID.Text)) { p = new byte[book.get_BookID().Length]; Temp = book.get_BookID(); for (int i = 0; i < book.get_BookID().Length; i++) { p[i] = (byte)Temp[i]; } FS.Write(p, 0, book.get_BookID().Length); } else { MessageBox.Show("Error !! Book_ID Length Very Large ."); } //Write Book Name. if (book.set_BookName(NameBook.Text)) { p = new byte[book.get_BookName().Length]; Temp = book.get_BookName(); for (int i = 0; i < book.get_BookName().Length; i++) { p[i] = (byte)Temp[i]; } FS.Write(p, 0, book.get_BookName().Length); } else { MessageBox.Show("Error !! Book_Name Length Very Large ."); } //Write Book Author. book.set_BookAuthor(BookAuthor.Text); Temp = book.get_BookAuthor(); FS.WriteByte((byte)book.get_BookAuthor().Length); p = new byte[book.get_BookAuthor().Length]; for (int i = 0; i < book.get_BookAuthor().Length; i++) { p[i] = (byte)Temp[i]; } FS.Write(p, 0, book.get_BookAuthor().Length); BookID.Clear(); NameBook.Clear(); FieldID.Clear(); BookAuthor.Clear(); FS.Close(); }
/// <summary> /// Delete the Book. /// </summary> /// <returns>Boolean</returns> public bool DeleteBook() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "Delete_Book"; command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0)); result = command.ExecuteReader(); } catch { Exception e = new Exception(); this._deleteOK = false; this._deletionMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this.DeleteOK); }
/// <summary> /// Saves the book. /// </summary> /// <returns>Book object</returns> public Book SaveBook() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_Book"; command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BookName", SqlDbType.VarChar, BookName.ToString(), 100)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
/// <summary> /// Saves the equipment. /// </summary> /// <returns>Equipment Object</returns> public Equipment SaveEquipment() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_Equipment"; command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentID", SqlDbType.Int, EquipmentID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentName", SqlDbType.VarChar, EquipmentName.ToString(), 50)); command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentDescription", SqlDbType.VarChar, EquipmentDescription.ToString(), 400)); command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentTypeID", SqlDbType.Int, EquipmentTypeID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentWeight", SqlDbType.Decimal, EquipmentWeight.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentCost", SqlDbType.Int, EquipmentCost.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Upgradable", SqlDbType.Bit, Upgradable.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
/// <summary> /// Saves the weapon. /// </summary> /// <returns>Weapon Object</returns> public Weapon SaveWeapon() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_Weapon"; command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponID", SqlDbType.Int, WeaponID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponName", SqlDbType.VarChar, WeaponName.ToString(), 50)); command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponTypeID", SqlDbType.Int, WeaponTypeID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponSizeID", SqlDbType.Int, WeaponSizeID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Cost", SqlDbType.Int, Cost.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@RateOfFire", SqlDbType.VarChar, RateOfFire.ToString(), 3)); command.Parameters.Add(dbconn.GenerateParameterObj("@DamageDieNumber", SqlDbType.Int, DamageDieNumber.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@DamageDieType", SqlDbType.Int, DamageDieType.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Stun", SqlDbType.Bit, Stun.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@StunDieNumber", SqlDbType.Int, DamageDieNumber.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@StunDieType", SqlDbType.Int, DamageDieType.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponDescription", SqlDbType.Text, WeaponDescription.ToString(), 4000)); command.Parameters.Add(dbconn.GenerateParameterObj("@Weight", SqlDbType.Decimal, Weight.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponProficiencyFeatID", SqlDbType.Int, WeaponProficiencyFeatID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@EmplacementPoints", SqlDbType.Int, EmplacementPoints.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@DoubleWeapon", SqlDbType.Bit, DoubleWeapon.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@AreaOfAttack", SqlDbType.Bit, AreaOfAttack.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Accurate", SqlDbType.Bit, AreaOfAttack.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Inaccurate", SqlDbType.Bit, AreaOfAttack.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Slugthrower", SqlDbType.Bit, Slugthrower.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@RequiresSeperateAmmo", SqlDbType.Bit, RequiresSeperateAmmo.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ExtraDamage", SqlDbType.Bit, ExtraDamage.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ExtraStunDamage", SqlDbType.Bit, ExtraStunDamage.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
/// <summary> /// Saves the armor. /// </summary> /// <returns>Armor Object</returns> public Armor SaveArmor() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_Armor"; command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorID", SqlDbType.Int, ArmorID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorTypeID", SqlDbType.Int, ArmorTypeID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorName", SqlDbType.VarChar, ArmorName.ToString(), 100)); command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorDescription", SqlDbType.VarChar, ArmorDescription.ToString(), 1000)); command.Parameters.Add(dbconn.GenerateParameterObj("@ReflexAdjustment", SqlDbType.Int, ReflexAdjustment.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@FortitudeAdjustment", SqlDbType.Int, FortitudeAdjustment.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorProficiencyFeatID", SqlDbType.Int, ArmorProficiencyFeatID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@EmplacementPoints", SqlDbType.Int, EmplacementPoints.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Cost", SqlDbType.Int, Cost.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@Weight", SqlDbType.Decimal, Weight.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@MaxDefBonus", SqlDbType.Int, MaxDefBonus.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
public override int GetHashCode() { return(BookID.GetHashCode() ^ TagID.GetHashCode()); }