private void doldur() { dto = MaasBLL.GetAll(); dataGridView1.DataSource = dto.Maaslar; dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[1].HeaderText = "User No"; dataGridView1.Columns[2].HeaderText = "Ad"; dataGridView1.Columns[3].HeaderText = "Soyad"; dataGridView1.Columns[4].Visible = false; dataGridView1.Columns[5].Visible = false; dataGridView1.Columns[6].Visible = false; dataGridView1.Columns[7].Visible = false; dataGridView1.Columns[8].HeaderText = "Yıl"; dataGridView1.Columns[9].HeaderText = "Ay"; dataGridView1.Columns[10].HeaderText = "Maaş"; dataGridView1.Columns[11].Visible = false; dataGridView1.Columns[12].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; cmbAylar.DataSource = dto.Aylar; cmbAylar.DisplayMember = "Ay"; cmbAylar.ValueMember = "ID"; cmbAylar.SelectedIndex = -1; }
private void btnKaydet_Click(object sender, EventArgs e) { if (maas.PersonelID == 0) { MessageBox.Show("Personelseç"); } else if (txtMaas.Text.Trim() == "") { MessageBox.Show("Maas giriniz"); } else if (txtYil.Text.Trim() == "") { MessageBox.Show("Yıl"); } else if (cmbAylar.SelectedIndex == -1) { MessageBox.Show("Ay seçiniz"); } else { maas.Ay_ID = Convert.ToInt32(cmbAylar.SelectedValue); maas.Miktar = Convert.ToInt32(txtMaas.Text); maas.YIL = Convert.ToInt32(txtYil.Text); MaasBLL.MaasEkle(maas, control); MessageBox.Show("Maaş Eklendi."); txtMaas.Clear(); maas = new MAA(); } }
private void btnSil_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Silinsinmi?", "Dikkat", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { MaasBLL.maasSil(detay.MaasID); MessageBox.Show("Silindi"); combofull = false; Temizle(); doldur(); } }
private void FrmMaasBilgileri_Load(object sender, EventArgs e) { dto = MaasBLL.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].Visible = false; dataGridView1.Columns[5].Visible = false; dataGridView1.Columns[6].Visible = false; dataGridView1.Columns[7].Visible = false; dataGridView1.Columns[8].Visible = false; 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; cmbAylar.DataSource = dto.Aylar; cmbAylar.DisplayMember = "Ay"; cmbAylar.ValueMember = "ID"; cmbAylar.SelectedIndex = -1; txtYil.Text = DateTime.Today.Year.ToString(); if (isUpdate) { txtAd.Text = detay.Ad; txtSoyad.Text = detay.Soyad; txtMaas.Text = detay.MaasMiktar.ToString(); txtYil.Text = detay.MaasYil.ToString(); txtUserNo.Text = detay.UserNo.ToString(); cmbAylar.SelectedValue = detay.MaasAyID; } }