Ejemplo n.º 1
0
        private void btnAddStyle_Click(object sender, EventArgs e)
        {
            clsSQL data = new clsSQL();

            data.addStyle(_style);
            _frmRec.populate("S");
            this.Close();
        }
        private void btnAddCategory_Click(object sender, EventArgs e)
        {
            clsSQL data = new clsSQL();

            data.addCategory(_cat);
            _frmRec.populate("C");
            this.Close();
        }
Ejemplo n.º 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            clsSQL data = new clsSQL();

            data.addIngredient(_ingredient);
            _frmRec.populate("I");
            this.Close();
        }
Ejemplo n.º 4
0
        private void btnFavorites_Click(object sender, EventArgs e)
        {
            clsSQL         data    = new clsSQL();
            frmShowResults results = new frmShowResults(data.getFavoriteRecipes());

            results.Show();
            this.Hide();
        }
Ejemplo n.º 5
0
 public frmShowRecipe(frmShowResults resultsForm, clsRecipe thisRec)
 {
     _data        = new clsSQL();
     _resultsForm = resultsForm;
     _thisRecipe  = thisRec;
     _ingredients = _data.getIngredients(_thisRecipe);
     InitializeComponent();
     populate();
 }
Ejemplo n.º 6
0
 public frmAdHoc(frmMenu menu)
 {
     _menu           = menu;
     _data           = new clsSQL();
     _strCategories  = new List <String>();
     _strIngredients = new List <clsIngredient>();
     _strRecipeName  = "";
     _strSeason      = new List <String>();
     _strStyles      = new List <String>();
     InitializeComponent();
     populate();
 }
 public frmAddRecipe()
 {
     _recNewRecipe    = new clsRecipe();
     _data            = new clsSQL();
     _ingredientsUsed = new List <clsIngredient>();
     _stylesUsed      = new List <String>();
     _catsUsed        = new List <String>();
     lstIngredients   = new ListView();
     lstCategories    = new ListView();
     lstStyles        = new ListView();
     InitializeComponent();
     populateIngredients();
     populateCategories();
     populateStyles();
 }
Ejemplo n.º 8
0
        private void btnFavorite_Click(object sender, EventArgs e)
        {
            clsRecipe rec  = new clsRecipe();
            clsSQL    data = new clsSQL();

            // str = DataGridView1.Rows[DataGridView.SelectedRows[0].Index].Cells[X].Value.ToString();
            rec.id         = Int32.Parse(dgvResults.Rows[dgvResults.SelectedRows[0].Index].Cells[1].Value.ToString());
            rec.name       = dgvResults.Rows[dgvResults.SelectedRows[0].Index].Cells[2].Value.ToString();
            rec.season     = dgvResults.Rows[dgvResults.SelectedRows[0].Index].Cells[3].Value.ToString();
            rec.directions = dgvResults.Rows[dgvResults.SelectedRows[0].Index].Cells[4].Value.ToString();
            Char[] chararr = dgvResults.Rows[dgvResults.SelectedRows[0].Index].Cells[5].Value.ToString().ToCharArray();
            rec.favorite = chararr[0];
            data.favoriteRecipe(rec);
            MessageBox.Show(rec.name + " has been added to your favorites!");
            dgvResults.Rows[dgvResults.SelectedRows[0].Index].Cells[5].Value = "Y";
        }
Ejemplo n.º 9
0
 public frmAddStyle(frmAddRecipe frmRec)
 {
     _frmRec = frmRec;
     _data   = new clsSQL();
     InitializeComponent();
 }