Example #1
0
        protected void DrpRoller_SelectedIndexChanged(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(2000);

            var sonuc = rolHak_veritabani.HakListele();

            RptHaklar.DataSource = sonuc.Veri;
            RptHaklar.DataBind();

            int secilenRolId = int.Parse(DrpRoller.SelectedValue);
            List <ViewRolHak> rolHakListesi = rolHak_veritabani.Listele().Veri;
            List <int>        hakListesi    = (from rh in rolHakListesi where rh.rol_id == secilenRolId select rh.hak_id).ToList();

            foreach (RepeaterItem item in this.RptHaklar.Items)
            {
                Label    label = item.FindControl("LblHakId") as Label;
                CheckBox check = item.FindControl("ChkHak") as CheckBox;
                int      hakId = int.Parse(label.Text);
                if (hakListesi.Contains(hakId))
                {
                    check.Checked = true;
                }
                else
                {
                    check.Checked = false;
                }
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var sonuc = rolHak_veritabani.RolListele();
                DrpRoller.DataSource     = sonuc.Veri;
                DrpRoller.DataTextField  = "ad";
                DrpRoller.DataValueField = "rol_id";
                DrpRoller.DataBind();

                var sonucHak = rolHak_veritabani.HakListele();
                RptHaklar.DataSource = sonucHak.Veri;
                RptHaklar.DataBind();

                divBilgiMesaji.Visible = false;
            }
        }