/// <summary> /// Delete the ItemAvailabilityType. /// </summary> /// <returns>Boolean</returns> public bool DeleteItemAvailabilityType() { 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_ItemAvailabilityType"; command.Parameters.Add(dbconn.GenerateParameterObj("@ItemAvailabilityTypeID", SqlDbType.Int, ItemAvailabilityTypeID.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); }
public ItemAvailabilityType GetItemAvailabilityType(string ItemAvailabilityTypeName) { return(GetSingleItemAvailabilityType("Select_ItemAvailabilityType", " ItemAvailabilityTypeName='" + ItemAvailabilityTypeID.ToString() + "'", "")); }
public ItemAvailabilityType SaveItemAvailabilityType() { 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_ItemAvailabilityType"; command.Parameters.Add(dbconn.GenerateParameterObj("@ItemAvailabilityTypeID", SqlDbType.Int, ItemAvailabilityTypeID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@ItemAvailabilityTypeName", SqlDbType.VarChar, ItemAvailabilityTypeName, 50)); command.Parameters.Add(dbconn.GenerateParameterObj("@ItemAvailabilityTypeDescription", SqlDbType.VarChar, ItemAvailabilityTypeDescription, 100)); command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorType", SqlDbType.Bit, ArmorType.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentType", SqlDbType.Bit, EquipmentType.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponType", SqlDbType.Bit, WeaponType.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message.ToString()); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }