private void PersonelCbx_SelectedIndexChanged(object sender, EventArgs e) { ToplamMesai(PersonelCbx.Text); int a = 0; int deneme = 0; if (Ay.SelectedItem != null && GuncelYil.SelectedItem != null) { deneme = int.Parse(GuncelYil.SelectedItem.ToString()); a = int.Parse(Ay.SelectedItem.ToString()); var item = Adibahce.Shift.Where(x => x.PersonelAdSoyad == PersonelCbx.SelectedItem.ToString()).Where(x => x.Yil_ID == deneme).Where(x => x.Ay_ID == a).ToList(); Yil.DataSource = item; Yil.Refresh(); } else if (GuncelYil.SelectedItem == null && Ay.SelectedItem == null) { var item = Adibahce.Shift.Where(x => x.PersonelAdSoyad == PersonelCbx.SelectedItem.ToString()).ToList(); Yil.DataSource = item; Yil.Refresh(); } else if (Ay.SelectedItem == null || GuncelYil.SelectedItem != null) { deneme = int.Parse(GuncelYil.SelectedItem.ToString()); var item = Adibahce.Shift.Where(x => x.PersonelAdSoyad == PersonelCbx.SelectedItem.ToString()).Where(x => x.Yil_ID == deneme).ToList(); Yil.DataSource = item; Yil.Refresh(); } else if (GuncelYil.SelectedItem == null || Ay.SelectedItem != null) { a = int.Parse(Ay.SelectedItem.ToString()); var item = Adibahce.Shift.Where(x => x.PersonelAdSoyad == PersonelCbx.SelectedItem.ToString()).Where(x => x.Ay_ID == a).ToList(); Yil.DataSource = item; Yil.Refresh(); } }
private void GuncelYil_SelectedIndexChanged(object sender, EventArgs e) { ToplamMesai(GuncelYil.Text); Ay.Items.Clear(); Ay.Text = null; int deneme = int.Parse(GuncelYil.SelectedItem.ToString()); var item = Adibahce.Shift.Where(x => x.Yil_ID == deneme).ToList(); Yil.DataSource = item; Yil.Refresh(); var query = Adibahce.Shift.Where(x => x.Yil_ID == deneme).Select(x => x.Ay_ID).Distinct(); foreach (var model in query) { Ay.Items.Add(model); } #region Ozet var model1 = Adibahce.Personel.Select(x => new { İsim = x.PersonelAdSoyad, Maaş = x.PersonelMaas, SaatÜcreti = x.PersonelMaas / 300, GüncelMesaiSaati = x.PersonelMesaiSaat, GüncelTutar = (x.PersonelMaas / 300) * x.PersonelMesaiSaat }).ToList(); Ozet.DataSource = model1; Ozet.Refresh(); #endregion }
private void button5_Click(object sender, EventArgs e) { var item = Adibahce.Shift.ToList(); Yil.DataSource = item; Yil.Refresh(); Adibahce.SaveChanges(); }
public void Yenile() { #region PersonelComboBoxYenile PersonelCbx.Items.Clear(); var combobox = Adibahce.Personel.Select(x => x.PersonelAdSoyad); foreach (var query in combobox) { PersonelCbx.Items.Add(query); } #endregion #region YılTarihiYenile GuncelYil.Items.Clear(); var deneme = Adibahce.Shift.Select(x => new { x.Yil_ID }).Distinct(); foreach (var model in deneme) { GuncelYil.Items.Add(model.Yil_ID); } #endregion #region DataGridViewYenile var item = Adibahce.Shift.Where(x => x.Ay_ID == DateTime.Now.Month).ToList(); Yil.DataSource = item; Yil.Refresh(); #endregion #region Ozet var model1 = Adibahce.Personel.Select(x => new { İsim = x.PersonelAdSoyad, Maaş = x.PersonelMaas, SaatÜcreti = x.PersonelMaas / 300, GüncelMesaiSaati = x.PersonelMesaiSaat, GüncelTutar = (x.PersonelMaas / 300) * x.PersonelMesaiSaat }).ToList(); Ozet.DataSource = model1; Ozet.Refresh(); #endregion }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { int yiltext = int.Parse(GuncelYil.Text); int aytext = int.Parse(Ay.Text); int guntext = int.Parse(Gun.Text); var deneme = Adibahce.Shift.Where(x => x.Yil_ID == yiltext && x.Ay_ID == aytext && x.Gun_ID == guntext).ToList(); Yil.DataSource = deneme; Yil.Refresh(); } catch (Exception) { MessageBox.Show("Lütfen Ay-Yıl Seçimi Yapınız", "Uyarı"); } }
private void Ay_SelectedIndexChanged(object sender, EventArgs e) { ToplamMesai(Ay.Text); Gun.Items.Clear(); int a = int.Parse(Ay.SelectedItem.ToString()); if (PersonelCbx.SelectedItem == null) { var item = Adibahce.Shift.Where(x => x.Ay_ID == a).ToList(); Yil.DataSource = item; Yil.Refresh(); } else { var item = Adibahce.Shift.Where(x => x.PersonelAdSoyad == PersonelCbx.SelectedItem.ToString()).Where(x => x.Ay_ID == a).ToList(); Yil.DataSource = item; Yil.Refresh(); } #region Ozet var model1 = Adibahce.Personel.Select(x => new { İsim = x.PersonelAdSoyad, Maaş = x.PersonelMaas, SaatÜcreti = x.PersonelMaas / 300, GüncelMesaiSaati = x.PersonelMesaiSaat, GüncelTutar = (x.PersonelMaas / 300) * x.PersonelMesaiSaat }).ToList(); Ozet.DataSource = model1; Ozet.Refresh(); #endregion int yiltext = int.Parse(GuncelYil.Text); int aytext = int.Parse(Ay.Text); var deneme = Adibahce.Shift.Where(x => x.Yil_ID == yiltext && x.Ay_ID == aytext).Select(x => x.Gun_ID).Distinct().ToList(); foreach (var item in deneme) { Gun.Items.Add(item); } }