private void NewShow_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.CUSTOMER' table. You can move, or remove it, as needed.
            this.cUSTOMERTableAdapter.Fill(this.pineSpringsPotteryDataSet.CUSTOMER);
            // TODO: This line of code loads data into the 'pineSpringsPotteryDataSet.SHOW' table. You can move, or remove it, as needed.
            this.sHOWTableAdapter.Fill(this.pineSpringsPotteryDataSet.SHOW);


            getCustomers();
            //collection.AddRange(customerNames);
            //addGuestTextBox.AutoCompleteCustomSource = collection;

            patterns  = DatabaseAccess.GetPatterns();
            pieces    = DatabaseAccess.GetPieces();
            showTypes = DatabaseAccess.GetShowTypes();
            cboShowType.DataSource = showTypes;


            hostNoTextBox.DataBindings[0].Parse          += new ConvertEventHandler(ParseNumeric);
            showDateDateTimePicker.DataBindings[0].Parse += new ConvertEventHandler(ShortDate);

            //new show
            if (show.showNo == 0)
            {
                bindingNavigatorAddNewItem.PerformClick();
            }
            else //(show != 0) view show number
            {
                int index = sHOWBindingNavigator.BindingSource.Find("ShowNo", show.showNo);
                sHOWBindingNavigator.BindingSource.Position = index;
                uneditable();
                getShowInfo();
            }
        }
 private void cboShowType_SelectedIndexChanged(object sender, EventArgs e)
 {
     showTypeTextBox.Text = DatabaseAccess.GetShowTypes().Find(show => show.showTypeName == cboShowType.SelectedItem.ToString()).showTypeNo.ToString();
     if (showTypeTextBox.Text == "0")
     {
         showTypeTextBox.Text = "";
     }
 }
 private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
 {
     newShow = true;
     guests.Clear();
     dgvGuestList.Rows.Clear();
     showDateDateTimePicker.Value = DateTime.Now;
     showTypeTextBox.Text         = DatabaseAccess.GetShowTypes().Find(show => show.showTypeName == cboShowType.SelectedItem.ToString()).showTypeNo.ToString();
     editable();
 }
 public NewShow(int pShow)
 {
     connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\PineSpringsPottery.accdb";
     connection       = new OleDbConnection(connectionString);
     show             = new Show();
     show.showNo      = pShow;
     if (show.showNo == 0)
     {
         newShow = true;
     }
     else
     {
         newShow = false;
     }
     newItemForm   = new Catalog(this);
     customers     = new List <Customer>();
     guest         = new Guest();
     guests        = new List <Guest>();
     guestCustomer = new Customer();
     piecesSold    = new List <showPiece>();
     piecesTaken   = new List <showPiece>();
     showTypes     = DatabaseAccess.GetShowTypes();
     InitializeComponent();
 }