Beispiel #1
0
        private void PersonelDetayForm_Load(object sender, EventArgs e)
        {
            var result = PersonelController.PersonelGetir(kisiId);

            lbl_AdSoyad.Text      = "Ad Soyad: " + result.Personel.Ad + " " + result.Personel.Soyad;
            lbl_KullaniciAdi.Text = "Kullanıcı Adı: " + result.Kullanici.KullaniciAdi;
            lbl_Rol.Text          = "Kullanıcı Türü: " + result.Rol.RolAdi;


            var       result2 = PersonelController.KullaniciSorumluDepartmanlar(kisiId);
            DataTable dt      = new DataTable();

            dt.Columns.Add("DepartmanId", typeof(int));
            dt.Columns.Add("DepartmanAdi", typeof(string));
            dt.Columns.Add("AdSoyad", typeof(string));
            foreach (var item in result2)
            {
                dt.Rows.Add(item.Departman.DepartmanId, item.Departman.DepartmanAdi, item.Personel.Ad + " " + item.Personel.Soyad);
            }
            grid_PersonelDepartman.DataSource = dt;
            gridView_personelDepartman.Columns["DepartmanId"].Visible = false;

            var       result1    = PersonelController.KullaniciZimmetleri(kisiId);
            DataTable dtDemirbas = new DataTable();

            dtDemirbas.Columns.Add("DemirbasKodu", typeof(string));
            dtDemirbas.Columns.Add("DemirbasAdi", typeof(string));
            foreach (var item in result1)
            {
                dtDemirbas.Rows.Add(item.Demirbas.DemirbasKodu, item.Demirbas.DemirbasAdi);
            }
            grid_personeldemirbas.DataSource = dtDemirbas;
        }