コード例 #1
0
ファイル: bands.cs プロジェクト: brianhenry617/BandTracker
        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);
        }
コード例 #2
0
ファイル: Band.cs プロジェクト: BlueishLeaf/FOOP202
        public int CompareTo(object obj)
        {
            Band tempAuthor = (Band)obj;
            int  returnVal  = BandName.CompareTo(tempAuthor.BandName);

            return(returnVal);
        }
コード例 #3
0
ファイル: bands.cs プロジェクト: brianhenry617/BandTracker
        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);
        }
コード例 #4
0
ファイル: bands.cs プロジェクト: brianhenry617/BandTracker
        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);
        }
コード例 #5
0
        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;
        }
コード例 #6
0
 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"));
 }
コード例 #7
0
ファイル: GigProvider.cs プロジェクト: RHMGLtd/sourcecode
 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()
     };
 }
コード例 #8
0
ファイル: bands.cs プロジェクト: brianhenry617/BandTracker
 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);
     }
 }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
ファイル: bands.cs プロジェクト: brianhenry617/BandTracker
        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();
            }
        }
コード例 #11
0
        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;
            }
        }
コード例 #12
0
        public int CompareTo(object obj)
        {
            Band that = obj as Band;

            return(BandName.CompareTo(that.BandName));
        }
コード例 #13
0
ファイル: BandProvider.cs プロジェクト: RHMGLtd/sourcecode
 public BandMetadata GetMetadata(BandName name)
 {
     return fs.ReadOut("Bands/Metadata/" + name.Value + ".json", new BandMetadata(name.Value));
 }
コード例 #14
0
ファイル: BandDiary.cs プロジェクト: RHMGLtd/sourcecode
 public BandDiary(BandName name)
 {
     BandName = name;
     Gigs = new List<Gig>();
 }
コード例 #15
0
ファイル: GigProvider.cs プロジェクト: RHMGLtd/sourcecode
 public PageOfResults<Gig> Get(BandName band, PagingParams paging)
 {
     throw new NotImplementedException();
 }
コード例 #16
0
ファイル: BandProvider.cs プロジェクト: RHMGLtd/sourcecode
 public BandDiary GetDiary(BandName name)
 {
     return fs.ReadOut("Bands/" + name.Value + ".json", new BandDiary(name));
 }
コード例 #17
0
ファイル: Bands.cs プロジェクト: RHMGLtd/sourcecode
 public BandMetadata GetMetadata(BandName name)
 {
     return session.Advanced.LuceneQuery<BandMetadata>()
                .WhereEquals("BandName", name.Value)
                .FirstOrDefault() ?? new BandMetadata {BandName = name.Value};
 }
コード例 #18
0
ファイル: Bands.cs プロジェクト: RHMGLtd/sourcecode
 public BandDiary GetDiary(BandName name)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
ファイル: RepeatingGig.cs プロジェクト: RHMGLtd/sourcecode
 public RepeatingGig()
 {
     BandNames = new BandName[] { };
     Created = DateTime.Now;
 }
コード例 #20
0
ファイル: Band.cs プロジェクト: CianTivnan/Week1Lab
 public int CompareTo(Band band)
 {
     return(BandName.CompareTo(band.BandName));
 }