Exemplo n.º 1
0
        private void AnaForm_Load(object sender, EventArgs e)
        {
            int currentYear = DateTime.Now.Year;
            int currentWeek = Parametre.HaftaNo(DateTime.Now);
            int currentday  = (int)DateTime.Now.DayOfWeek;



            List <int> Haftalar = new List <int>();

            for (int i = 1; i <= 54; i++)
            {
                Haftalar.Add(i);
            }

            List <string> Gunler = new List <string>();

            Gunler.Add("Pazartesi");
            Gunler.Add("Salı");
            Gunler.Add("Çarşamba");
            Gunler.Add("Perşembe");
            Gunler.Add("Cuma");
            Gunler.Add("Cumartesi");
            Gunler.Add("Pazar");

            cmbHafta.DataSource = Haftalar;
            cmbGun.DataSource   = Gunler;

            cmbYil.Text          = currentYear.ToString();
            cmbHafta.Text        = currentWeek.ToString();
            cmbGun.SelectedIndex = currentday - 1;

            GunlukSevkListele();
        }
        private void SevkiyatGiris_FormClosed(object sender, FormClosedEventArgs e)
        {
            Parametre.currentday  = (int)dateTimePicker1.Value.DayOfWeek;
            Parametre.currentYear = dateTimePicker1.Value.Year;
            Parametre.currentWeek = Parametre.HaftaNo(dateTimePicker1.Value);


            AnaForm anaForm = new AnaForm();

            anaForm.Name = "anaForm";
            if (Application.OpenForms["anaForm"] == null)
            {
            }
            else
            {
                ((AnaForm)Application.OpenForms["anaForm"]).dgvSevkiyatlar.DataSource = sevkiyatManager.GunlukSevkiyatlariListele(Parametre.currentYear, Parametre.currentWeek, Parametre.currentday);

                ((AnaForm)Application.OpenForms["anaForm"]).cmbYil.Text          = Parametre.currentYear.ToString();
                ((AnaForm)Application.OpenForms["anaForm"]).cmbHafta.Text        = Parametre.currentWeek.ToString();
                ((AnaForm)Application.OpenForms["anaForm"]).cmbGun.SelectedIndex = Parametre.currentday - 1;

                ((AnaForm)Application.OpenForms["anaForm"]).lblYil.Text   = ((AnaForm)Application.OpenForms["anaForm"]).cmbYil.Text + ",";
                ((AnaForm)Application.OpenForms["anaForm"]).lblHafta.Text = ((AnaForm)Application.OpenForms["anaForm"]).cmbHafta.Text + ",";
                ((AnaForm)Application.OpenForms["anaForm"]).lblGun.Text   = ((AnaForm)Application.OpenForms["anaForm"]).cmbGun.Text;
            }
        }
Exemplo n.º 3
0
        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            int currentYear = dateTimePicker1.Value.Year;
            int currentWeek = Parametre.HaftaNo(dateTimePicker1.Value);
            int currentday  = (int)dateTimePicker1.Value.DayOfWeek;

            cmbYil.Text          = currentYear.ToString();
            cmbHafta.Text        = currentWeek.ToString();
            cmbGun.SelectedIndex = currentday - 1;
        }