public List <BandName> GetBandName() { MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"SELECT books.* FROM authors JOIN BandName_Venues ON (bandName_id=BandName_BandName.Venue_id) JOIN books ON (bandName_bandName.bandName_id=books.id) WHERE bandName_id=@AuthorId;"; cmd.Parameters.Add(new MySqlParameter("@BandNameId", _id)); var rdr = cmd.ExecuteReader() as MySqlDataReader; List <BandName> BandName = new List <BandName> { }; while (rdr.Read()) { int bookId = rdr.GetInt32(0); string BandName = rdr.GetString(1); string BandName = rdr.GetString(2); BandName newBandName = new BandName(bandName, venue, bookId); bandName.Add(newbandName); } rdr.Dispose(); conn.Close(); if (conn != null) { conn.Dispose(); } return(bandName); }
public int CompareTo(object obj) { Band tempAuthor = (Band)obj; int returnVal = BandName.CompareTo(tempAuthor.BandName); return(returnVal); }
public static List <BandName> GetAllBandName() { List <BandName> allBandName = new List <BandName> { }; MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"SELECT * FROM bandName;"; var rdr = cmd.ExecuteReader() as MySqlDataReader; while (rdr.Read()) { int bandNameId = rdr.GetInt32(0); string bandName = rdr.GetString(1); BandName newBandName = new BandName(bandName, bandNameId); allBandName.Add(newBandName); } conn.Close(); if (conn != null) { conn.Dispose(); } return(allBandName); }
public static BandName Find(int id) { MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"SELECT * FROM authors WHERE id = (@searchId);"; MySqlParameter searchId = new MySqlParameter(); searchId.ParameterName = "@searchId"; searchId.Value = id; cmd.Parameters.Add(searchId); var rdr = cmd.ExecuteReader() as MySqlDataReader; int bandNameId = 0; string bandName = ""; while (rdr.Read()) { bandNameId = rdr.GetInt32(0); bandName = rdr.GetString(1); } BandName newBandName = new BandName(bandName, bandNameId); conn.Close(); if (conn != null) { conn.Dispose(); } return(newBandName); }
private void lvBandNos_MouseClick(object sender, MouseEventArgs e) { if (lvBandVars.SelectedItem == null) { return; } TreeNode trNode = lvBandNos.GetNodeAt(e.Location); if (trNode == null || trNode.Parent == null) { return; } BandName bandName = trNode.Tag as BandName; BandVarItem item = lvBandVars.SelectedItem as BandVarItem; item.BandVarRef = bandName.ToString(); item.BandNo = bandName.BandNo; // int idx = lvBandVars.SelectedIndex; BandVarItem[] vars = lvBandVars.Items.Cast <BandVarItem>().ToArray(); lvBandVars.Items.Clear(); foreach (BandVarItem it in vars) { lvBandVars.Items.Add(it); } lvBandVars.SelectedIndex = idx; }
public void Test() { Assert.AreEqual("The Knife", BandName.Generate("knife")); Assert.AreEqual("Tartart", BandName.Generate("tart")); Assert.AreEqual("Sandlesandles", BandName.Generate("sandles")); Assert.AreEqual("The Bed", BandName.Generate("bed")); }
public PageOfResults<Gig> Get(BandName band, PagingParams paging) { var result = gigSummary.BandDiaries().Where(x => x.BandName.Value.Tidy() == band.Value.Tidy()).FirstOrDefault().Gigs; return new PageOfResults<Gig> { CurrentPageNumber = paging.PageNumber, NumberOfPages = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(result.Count()) / Convert.ToDouble(paging.PageSize))), TotalNumberOfRecords = result.Count(), Results = result.Skip(((paging.PageNumber - 1) * paging.PageSize)).Take(paging.PageSize).ToList() }; }
public override bool Equals(System.Object otherBandName) { if (!(otherBandName is bandName)) { return(false); } else { BandName newBandName = (BandName)otherBandName; bool idEquality = this.GetId() == newBandName.GetId(); bool nameEquality = this.GetName() = newBandName.GetBandName(); return(idEquality && nameEquality); } }
private bool IsColorRingCorrectForBand(ElectronicColorRing bandToCheck, BandName bandToVerify) { switch (bandToVerify) { case BandName.BandA: case BandName.BandB: return(bandToCheck.SignificantFigure != null); case BandName.BandC: return(bandToCheck.Multiplier != null); case BandName.BandD: return(bandToCheck.TolerancePercent != null); default: return(false); } }
public void AddbandName(BandName newBandName) { MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"INSERT INTO bandName_venues (bandName_id, venue_id) VALUES (@bandNameId, @venueId);"; cmd.Parameters.Add(new MySqlParameter("@bandNameId", _id)); cmd.Parameters.Add(new MySqlParameter("@venueId", newbandName.GetId())); cmd.ExecuteNonQuery(); _id = (int)cmd.LastInsertedId; conn.Close(); if (conn != null) { conn.Dispose(); } }
public void CrankGoodTunes(BandName band) { switch (band) { case BandName.deftones: MessageBox.Show("So forget about me..."); break; case BandName.PTP: MessageBox.Show("Tick tick tock..."); break; case BandName.SkinnyPuppy: MessageBox.Show("Water vapor, to air..."); break; case BandName.TonesOnTail: MessageBox.Show("Oooooh the rain. Oh the rain."); break; } }
public int CompareTo(object obj) { Band that = obj as Band; return(BandName.CompareTo(that.BandName)); }
public BandMetadata GetMetadata(BandName name) { return fs.ReadOut("Bands/Metadata/" + name.Value + ".json", new BandMetadata(name.Value)); }
public BandDiary(BandName name) { BandName = name; Gigs = new List<Gig>(); }
public PageOfResults<Gig> Get(BandName band, PagingParams paging) { throw new NotImplementedException(); }
public BandDiary GetDiary(BandName name) { return fs.ReadOut("Bands/" + name.Value + ".json", new BandDiary(name)); }
public BandMetadata GetMetadata(BandName name) { return session.Advanced.LuceneQuery<BandMetadata>() .WhereEquals("BandName", name.Value) .FirstOrDefault() ?? new BandMetadata {BandName = name.Value}; }
public BandDiary GetDiary(BandName name) { throw new NotImplementedException(); }
public RepeatingGig() { BandNames = new BandName[] { }; Created = DateTime.Now; }
public int CompareTo(Band band) { return(BandName.CompareTo(band.BandName)); }