コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _service = new Recipes_Services();

            this.rptRecipe.DataSource = _service.GetRecipeByCategoryID(7);
            this.rptRecipe.DataBind();
        }
コード例 #2
0
        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;
                    }
                }
            }
        }
コード例 #3
0
ファイル: receitas.aspx.cs プロジェクト: pmateus91/Recipes
        protected void Page_Load(object sender, EventArgs e)
        {
            _service = new Recipes_Services();
            this.rptRecipe.DataSource = _service.GetALLValidated();

            this.rptRecipe.DataBind();
        }
コード例 #4
0
ファイル: FrmRecipesInsert.cs プロジェクト: pmateus91/Recipes
 public FrmRecipesInsert(bool isInsert, int id = 0)
 {
     InitializeComponent();
     _rService  = new Recipes_Services();
     _cService  = new Categories_Services();
     _iService  = new Ingredients_Services();
     _riService = new RecipesIngredients_Services();
 }
コード例 #5
0
 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();
 }
コード例 #6
0
        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();
        }
コード例 #7
0
ファイル: FrmRecipes.cs プロジェクト: pmateus91/Recipes
 public FrmRecipes(string title)
 {
     InitializeComponent();
     _service = new Recipes_Services();
 }
コード例 #8
0
 public FrmRecipesDetails(int id)
 {
     InitializeComponent();
     _id      = id;
     _service = new Recipes_Services();
 }