Exemple #1
0
 private void doldur()
 {
     dto = PersonelBLL.GetAll();
     dataGridView1.DataSource            = dto.Personeller;
     dataGridView1.Columns[0].Visible    = false;
     dataGridView1.Columns[1].HeaderText = "User No";
     dataGridView1.Columns[2].HeaderText = "Ad";
     dataGridView1.Columns[3].HeaderText = "Soyad";
     dataGridView1.Columns[4].HeaderText = "Departman";
     dataGridView1.Columns[5].HeaderText = "Pozisyon";
     dataGridView1.Columns[6].Visible    = false;
     dataGridView1.Columns[7].Visible    = false;
     dataGridView1.Columns[8].HeaderText = "Maaş";
     dataGridView1.Columns[9].Visible    = false;
     dataGridView1.Columns[10].Visible   = false;
     dataGridView1.Columns[11].Visible   = false;
     dataGridView1.Columns[12].Visible   = false;
     dataGridView1.Columns[13].Visible   = false;
     cmbDepartman.DataSource             = dto.Departmanlar;
     cmbDepartman.DisplayMember          = "DepartmanAd";
     cmbDepartman.ValueMember            = "ID";
     cmbDepartman.SelectedIndex          = -1;
     if (dto.Departmanlar.Count > 0)
     {
         combofull = true;
     }
     cmbPozisyon.DataSource    = dto.Pozisyonlar;
     cmbPozisyon.DisplayMember = "PozisyonAd";
     cmbPozisyon.ValueMember   = "ID";
     cmbPozisyon.SelectedIndex = -1;
 }
        public ActionResult StaffInsert(PersonelDTO personel, UyeDTO uye)
        {
            uye.KullaniciAdi = (personel.Ad + personel.Soyad).Trim().Replace(" ", string.Empty).ToLower();
            uye.Parola       = PassManager.Base64Encrypt(personel.TCNo);
            int id = _uyeService.Insert(uye);

            _personelService.Insert(personel, id);
            return(RedirectToAction("StaffList", "Staff"));
        }
        public static PersonelDTO GetAll()
        {
            PersonelDTO dto = new PersonelDTO();

            dto.Departmanlar = DepartmanDAO.DepartmanGetir();
            dto.Pozisyonlar  = PozisyonDAO.PozisyonGetir();
            dto.Personeller  = PersonelDAO.PersonelGetir();
            return(dto);
        }
Exemple #4
0
        public async Task <IActionResult> Guncel([FromBody] PersonelDTO pDto)
        {
            Personel per = new Personel();

            per.Name    = pDto.name;
            per.Surname = pDto.surName;
            per.CityId  = pDto.cityId;
            _repPersonel.Update(per);
            await _repPersonel.Comit();

            return(Json(pDto));
        }
        public async Task <JsonResult> Ekle([FromBody] PersonelDTO pr)
        {
            Personel personel = new Personel();

            personel.PersonelAd    = pr.personelAd;
            personel.PersonelSoyad = pr.personelSoyad;
            personel.SehirId       = pr.sehirId;

            _reppersonel.Add(personel);
            await _reppersonel.Comit();

            return(Json(pr));
        }
 public void Update(PersonelDTO personel)
 {
     try
     {
         var perEntity = _personelRepo.Find(personel.PersonelID);
         AutoMapper.Mapper.DynamicMap(personel, perEntity);
         _personelRepo.Update(perEntity);
         _uow.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public async Task <PersonelDTO> AddPersonel(PersonelDTO personelDTO)
        {
            HttpRequestMessage requestMessage = new HttpRequestMessage()
            {
                RequestUri = new Uri("http://localhost:57892/api/Personel/Add"),
                Method     = HttpMethod.Post,
                Content    = HttpRequestExtensions.ContentAsByteJson(personelDTO),
            };
            var response = await _httpClient.SendAsync(requestMessage);

            var result = HttpResponseExtensions.ContentAsType <PersonelDTO>(response);

            return(result);
        }
        public async Task <ActionResult <PersonelDTO> > GetKisi(int id)
        {
            PersonelDTO kisi = await _context.Kisiler
                               .Select(x => new PersonelDTO()
            {
                Id = x.Id, Ad = x.Ad, Soyad = x.Soyad, GirisTarihi = x.PersonelBilgi.GirisTarihi, CikisTarihi = x.PersonelBilgi.CikisTarihi
            })
                               .SingleOrDefaultAsync(x => x.Id == id);

            if (kisi == null)
            {
                return(NotFound("İstenilen personel bulunamadı"));
            }
            return(Ok(kisi));
        }
 public ActionResult PersonelEkle(PersonelDTO p)
 {
     if (ModelState.IsValid)
     {
         Personel personel = new Personel()
         {
             Ad             = p.Ad,
             Soyad          = p.Soyad,
             DogumTarihi    = p.DogumTarihi,
             IseGirisTarihi = p.IseGirisTarihi,
             Email          = p.Email,
             Telefon        = p.Telefon
         };
         DataService.Service.PersonelService.Insert(personel);
     }
     return(RedirectToAction("Index"));
 }
Exemple #10
0
 public void Insert(PersonelDTO personel, int uyeID)
 {
     // install - package automapper - version:4.1
     try
     {
         var entity = AutoMapper.Mapper.DynamicMap <Personel>(personel);
         entity.Durum   = true;
         entity.YetkiID = 2;
         entity.UyeID   = uyeID;
         _personelRepo.Insert(entity);
         _uow.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #11
0
        private void FrmPersonelBilgileri_Load(object sender, EventArgs e)
        {
            dto = PersonelBLL.GetAll();
            cmbDepartman.DataSource    = dto.Departmanlar;
            cmbDepartman.DisplayMember = "DepartmanAd";
            cmbDepartman.ValueMember   = "ID";
            cmbDepartman.SelectedIndex = -1;
            cmbPozisyon.DataSource     = dto.Pozisyonlar;
            cmbPozisyon.DisplayMember  = "PozisyonAd";
            cmbPozisyon.ValueMember    = "ID";
            cmbPozisyon.SelectedIndex  = -1;
            if (dto.Departmanlar.Count > 0)
            {
                combofull = true;
            }
            if (isUpdate)
            {
                txtAd.Text                 = detay.Ad;
                txtAdress.Text             = detay.Adres;
                txtMaas.Text               = detay.Maas.ToString();
                txtPassword.Text           = detay.password;
                txtSoyad.Text              = detay.Soyad;
                txtUserNo.Text             = detay.UserNo.ToString();
                chisAdmin.Checked          = detay.isAdmin;
                cmbDepartman.SelectedValue = detay.DepartmanID;
                cmbPozisyon.SelectedValue  = detay.PozisyonID;
                resim2        = Application.StartupPath + "\\resimler\\" + detay.Resim;
                txtResim.Text = resim2;
                pictureBox1.Load(resim2);

                if (!UserStatic.isAdmin)
                {
                    txtAd.Enabled        = false;
                    txtSoyad.Enabled     = false;
                    txtMaas.Enabled      = false;
                    txtUserNo.Enabled    = false;
                    chisAdmin.Enabled    = false;
                    cmbDepartman.Enabled = false;
                    cmbPozisyon.Enabled  = false;
                }
            }
        }
Exemple #12
0
 private void btnPersonel_Click(object sender, EventArgs e)
 {
     if (!UserStatic.isAdmin)
     {
         FrmPersonelBilgileri frm = new FrmPersonelBilgileri();
         PersonelDTO          dto = new PersonelDTO();
         dto = PersonelBLL.GetAll();
         PersonelDetayDTO detay = new PersonelDetayDTO();
         detay        = dto.Personeller.First(x => x.PersoneID == UserStatic.PersonelID);
         frm.isUpdate = true;
         frm.detay    = detay;
         frm.ShowDialog();
         this.Visible = true;
     }
     else
     {
         FrmPersonelListesi frm = new FrmPersonelListesi();
         this.Hide();
         frm.ShowDialog();
         this.Visible = true;
     }
 }
Exemple #13
0
        public async Task <ActionResult <PersonelDTO> > Update(PersonelDTO personelDTO)
        {
            var personel = await _personelService.UpdateAsync(personelDTO);

            return(personel);
        }
 public ActionResult StaffUpdate(PersonelDTO personel, UyeDTO uye)
 {
     _personelService.Update(personel);
     _uyeService.Update(uye);
     return(RedirectToAction("StaffList", "Staff"));
 }
        public IActionResult AddPersonel(PersonelDTO personelDTO)
        {
            var personel = _personelClient.AddPersonel(personelDTO);

            return(Ok());
        }
Exemple #16
0
 public StaffService(UnitofWork uow)
 {
     _uow          = uow;
     _personelRepo = _uow.GetRepository <Personel>();
     _personelDTO  = new PersonelDTO();
 }
Exemple #17
0
 public void Post([FromBody] PersonelDTO dto)
 {
     var ss = 11;
 }