Esempio n. 1
0
        protected void LinkButtonBul_Click(object sender, EventArgs e)
        {
            CheckBoxCategori.ClearSelection();
            LinkButton linkButton = (LinkButton)sender;

            urunID       = Convert.ToInt32(linkButton.CommandArgument);
            LabelID.Text = urunID.ToString();
            Product urun = repoUrun.GetBy(g => g.ID == urunID);

            Name.Text                   = urun.Name;
            Description.Text            = urun.Description;
            stock.Text                  = urun.Stock.ToString();;
            Price.Text                  = urun.Price.ToString();
            DropDownBrand.SelectedValue = urun.BrandID.ToString();
            List <ProductCategory> categories = repoProductCategory.GetAll().Where(w => w.ProductID == urun.ID).ToList();

            foreach (ListItem item in CheckBoxCategori.Items)
            {
                for (int i = 0; i < categories.Count; i++)
                {
                    if (item.Value == categories[i].CategoryID.ToString())
                    {
                        item.Selected = true;
                    }
                }
            }
            ButtonEkle.Text = "GÜNCELLE";
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["mysession"] != null)  Session["mysession"].ToString();
            //cookie
            //if (Request.Cookies["MyCookie"] != null)
            //{
            //    brandbaslik.InnerText = Request.Cookies["MyCookie"]["Ad"];
            //}
            if (IsPostBack == false)// if(!IsPostBack)
            {
                CheckBoxCategori.DataSource = repoCategory.GetAll().ToList();
                CheckBoxCategori.DataBind();
                DropDownBrand.DataSource = repoBrand.GetAll().ToList();
                DropDownBrand.DataBind();

                Yukle();
                katYukle();
            }
        }