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(); }
private void btnAdd_Click(object sender, EventArgs e) { clsSQL data = new clsSQL(); data.addIngredient(_ingredient); _frmRec.populate("I"); this.Close(); }
private void btnFavorites_Click(object sender, EventArgs e) { clsSQL data = new clsSQL(); frmShowResults results = new frmShowResults(data.getFavoriteRecipes()); results.Show(); this.Hide(); }
public frmShowRecipe(frmShowResults resultsForm, clsRecipe thisRec) { _data = new clsSQL(); _resultsForm = resultsForm; _thisRecipe = thisRec; _ingredients = _data.getIngredients(_thisRecipe); InitializeComponent(); populate(); }
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(); }
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"; }
public frmAddStyle(frmAddRecipe frmRec) { _frmRec = frmRec; _data = new clsSQL(); InitializeComponent(); }