Ejemplo n.º 1
0
        public void Doldur()
        {
            List <Trainer> liste = islem.HepsiniGetir().OrderByDescending(p => p.CreatedDate).ToList();

            GridviewSiniflar.DataSource = liste;
            GridviewSiniflar.DataBind();
            LabelSayi.Text = String.Format("<span class='label label-info'><strong>{0}</strong></span> adet eğitmen listeleniyor... ", liste.Count);
        }
Ejemplo n.º 2
0
        protected void GridviewSiniflar_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Classroom k = (Classroom)e.Row.DataItem;
                if (k.IsActive == true)
                {
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ToolTip       = "Pasif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).Text          = "Pasif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).CssClass      = "btn btn-danger btn-mini";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).OnClientClick = "return confirm('Kullanıcı Pasif Edilecek');";
                }
                else
                {
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).ToolTip       = "Aktif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).Text          = "Aktif Et";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).CssClass      = "btn btn-success btn-mini";
                    (e.Row.FindControl("LinkbuttonAktif") as LinkButton).OnClientClick = "return confirm('Kullanıcı Aktif Edilecek');";
                }


                int id;

                Label        lblgelenid   = (Label)e.Row.FindControl("lblID");
                Label        lblsecid     = (Label)e.Row.FindControl("Label1");
                Label        lbltrgelenid = (Label)e.Row.FindControl("lbltr");
                DropDownList ddl1         = (DropDownList)e.Row.FindControl("dropdownBolum");
                DropDownList ddl2         = (DropDownList)e.Row.FindControl("dropdownEgitmen");
                Label        lbldurum     = (Label)e.Row.FindControl("lbldurum");

                SectionsRepository bolum   = new SectionsRepository();
                TrainerRepository  egitmen = new TrainerRepository();
                int     sectionid          = Convert.ToInt32(lblsecid.Text);
                Section sec = new Section();
                sec                 = bolum.TekGetir(sectionid);
                ddl1.DataSource     = bolum.HepsiniGetir();
                ddl1.DataTextField  = "Name";
                ddl1.DataValueField = "Id";
                ddl1.SelectedValue  = sec.Id.ToString();
                ddl1.DataBind();
                int     traineridd = Convert.ToInt32(lbltrgelenid.Text);
                Trainer tid        = new Trainer();
                tid = egitmen.TekGetir(traineridd);
                ddl2.SelectedValue  = tid.Id.ToString();
                ddl2.DataSource     = egitmen.HepsiniGetir();
                ddl2.DataTextField  = "FullName";
                ddl2.DataValueField = "Id";
                ddl2.DataBind();
            }
        }