protected void Page_Load(object sender, EventArgs e) { _service = new Recipes_Services(); this.rptRecipe.DataSource = _service.GetRecipeByCategoryID(7); this.rptRecipe.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { _service = new Recipes_Services(); _riService = new RecipesIngredients_Services(); _frService = new FavouriteRecipe_Services(); _uService = new Users_Services(); if (!String.IsNullOrEmpty(Session["ID"].ToString())) { id = int.Parse(Session["ID"].ToString()); } foreach (Recipe recipe in _service.GetByID(id)) { lblTitle.Text = recipe.Title; lblCategoryName.Text = recipe.CategoryName.ToString(); lblDuration.Text = TimeSpan.Parse(recipe.Duration.ToString()).TotalMinutes.ToString() + " Minutos"; lblDifficulty.Text = recipe.Difficulty.ToString(); lblRating.Text = recipe.Rating.ToString(); lblUser.Text = recipe.UserName.ToString(); lblInstructions.Text = recipe.Instructions.ToString(); { } CreateDataTable(); foreach (RecipeIngredient recipeIngredient in _riService.GetById(id)) { //dt = (DataTable)ViewState["Records"]; DataRow row = dt.NewRow(); row["Ingrediente"] = recipeIngredient.IngredientName; row["Quantidade"] = recipeIngredient.Quantity; row["Unidade"] = recipeIngredient.Unit; dt.Rows.Add(row); gvIngredientsInsert.DataSource = dt; gvIngredientsInsert.DataBind(); } } _membershipUsername = User.Identity.Name; foreach (User user in _uService.GetALL()) { if (_membershipUsername == user.MembershipUsername) { userId = user.ID; } } foreach (FavouriteRecipe favouriteRecipe in _frService.GetALL(userId)) { if (favouriteRecipe.RecipeID == id) { if (favouriteRecipe.IsFavourite == true) { btnFavoritos.Visible = false; } else { btnFavoritos.Visible = true; } } } }
protected void Page_Load(object sender, EventArgs e) { _service = new Recipes_Services(); this.rptRecipe.DataSource = _service.GetALLValidated(); this.rptRecipe.DataBind(); }
public FrmRecipesInsert(bool isInsert, int id = 0) { InitializeComponent(); _rService = new Recipes_Services(); _cService = new Categories_Services(); _iService = new Ingredients_Services(); _riService = new RecipesIngredients_Services(); }
protected void Page_Load(object sender, EventArgs e) { _rService = new Recipes_Services(); _cService = new Categories_Services(); _iService = new Ingredients_Services(); _riService = new RecipesIngredients_Services(); _uService = new Users_Services(); FillComboBoxes(); CreateDataTable(); }
protected void Page_Load(object sender, EventArgs e) { _service = new Recipes_Services(); _uService = new Users_Services(); _membershipUsername = User.Identity.Name; foreach (User user in _uService.GetALL()) { if (_membershipUsername == user.MembershipUsername) { userId = user.ID; } } this.rptRecipe.DataSource = _service.GetRecipeByUserID(userId); this.rptRecipe.DataBind(); }
public FrmRecipes(string title) { InitializeComponent(); _service = new Recipes_Services(); }
public FrmRecipesDetails(int id) { InitializeComponent(); _id = id; _service = new Recipes_Services(); }