Skip to content

Instantly share code, notes, and snippets.

View gist:4651300
public static int CountBirds(string baseBirds = "*", string baseBirder = "*", string baseRegion = "*", string baseDate = "*")
{
SqlCommand selectCommand;
string sql = "SELECT SUM(BirdCount.Counted) FROM Bird INNER JOIN BirdCount ON Bird.BirdID = BirdCount.BirdID " +
"INNER JOIN Birder ON BirdCount.BirderID = Birder.BirderID INNER JOIN Region ON BirdCount.RegionID = Region.RegionID " +
"where BirdCount.BirdID ='" + baseBirds + "' AND BirdCount.BirderID = '" + baseBirder + "' AND BirdCount.RegionID = '" + baseRegion + "' AND BirdCount.CountDate = '" + baseDate + "'";
if (baseBirds == "*")
{
sql.Replace("BirdCount.BirdID ='" + baseBirds + "' AND", String.Empty);
View gist:4109166
public int CompareTo(object obj)
{
if (obj is Book)
{
Book otherBook = (Book)obj;
if (this.Title != otherBook.Title)
{
return this.Title.CompareTo(otherBook.Title);
}
}
View gist:4054148
private void searchButton_Click(object sender, EventArgs e)
{
try
{
DataSet dataSet = new DataSet();
dataSet = BusinessEntities.PermitData.GetApplications(firstNameTextBox.Text, lastNameTextBox.Text);
searchJobsByNameDataGridView.DataSource = dataSet.Tables[0];
}
catch (Exception ex)
{
View gist:3864450
CLASS
namespace DiceGame
{
class TwoDice
{
private static string filepath = @"C:\Users\Talia\Desktop\PROG 120\DiceGame\dice\";
private int value;
private Image image1;
private Image image2;
View gist:3862706
public static void Roll()
{
Random r = new Random();
Random r2 = new Random();
int roll = r.Next(1, 7);
int roll2 = r2.Next(1, 7);
}
//label1.Text = roll.ToString();
View gist:2922267
//Nicole Buck
//Prog 109 Project 3
var bet = 0;
var credits = 100;
var count = 0;
var slotImages = new Array("lemon.png", "plum.png", "bell.png", "diamond.png", "clover.jpg");
View gist:2922001
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
View gist:2915803
public void SavingFile()
{
StreamWriter writer = new StreamWriter("books.txt");
foreach (Book book in books)
{
writer.WriteLine(book.ToString());
}
}
View gist:2915784
public void SavingFile()
{
StreamWriter writer = new StreamWriter("books.txt");
foreach (Book book in books)
{
writer.WriteLine(book.ToString());
}
}
View gist:2914021
private void removeButton_Click(object sender, EventArgs e)
{
if (removeIsbnRadioButton.Checked)
{
foreach (Book book in books)
{
if (book.Isbn.Normalize().Equals(searchBookTextBox.Text.Normalize()))
{
books.Remove(book);
break;