private void BtnYeniKargo_Click(object sender, EventArgs e)
        {
            int          KuryeID       = cbxKuryeler.SelectedIndex + 1;
            Kargo        yeniKargo     = new Kargo(Convert.ToInt32(dgwKargo.CurrentRow.Cells[1].Value), dateTimePicker1.Value);
            KHareketleri guncelHareket = new KHareketleri(Convert.ToInt32(dgwKargo.CurrentRow.Cells[0].Value), Convert.ToInt32(dgwKargo.CurrentRow.Cells[1].Value), KuryeID, tbxDurumGuncel.Text);

            islemler.KargoGuncelle(yeniKargo);
            islemler.KargoHareketGuncelle(guncelHareket);
            islemler.LoadKargoHareket(dgwKargo);
        }
Example #2
0
        public void KargoHareketEkle(KHareketleri yeniHareket)
        {
            ConnectionControl();
            SqlCommand command = new SqlCommand("INSERT INTO KargoHareketleri VALUES (@KargoID,@KuryeID,@Durum)", conn);

            command.Parameters.AddWithValue("KargoID", yeniHareket.KargoID);
            command.Parameters.AddWithValue("KuryeID", yeniHareket.KuryeID);
            command.Parameters.AddWithValue("Durum", yeniHareket.Durum);


            command.ExecuteNonQuery();

            conn.Close();
        }
Example #3
0
        public void KargoHareketGuncelle(KHareketleri guncelHareket)
        {
            ConnectionControl();
            string     sql     = "UPDATE KargoHareketleri SET KargoID=@kargoID,KuryeID=@kuryeID,Durum=@durum WHERE HareketID=@hareketID";
            SqlCommand command = new SqlCommand(sql, conn);

            command.Parameters.AddWithValue("hareketID", guncelHareket.HareketID);
            command.Parameters.AddWithValue("kargoID", guncelHareket.KargoID);
            command.Parameters.AddWithValue("kuryeID", guncelHareket.KuryeID);
            command.Parameters.AddWithValue("durum", guncelHareket.Durum);


            command.ExecuteNonQuery();

            conn.Close();
        }
Example #4
0
        private void BtnYeniKargo_Click(object sender, EventArgs e)
        {
            bool secim = true;

            if (rbcGonderici.Checked == true)
            {
                secim = true;
            }

            else if (rdbAlici.Checked == true)
            {
                secim = false;
            }

            Kargo yeniKargo = new Kargo(Convert.ToInt32(lblAliciID.Text), Convert.ToInt32(lblGondericiID.Text), Convert.ToInt32(lblKargoTuruID.Text), Convert.ToDecimal(tbxDesi.Text), Convert.ToDecimal(tbxAgirlik.Text), secim, Convert.ToDecimal(tbxUcret.Text));

            islemler.KargoEkle(yeniKargo);

            KHareketleri yeniHareket = new KHareketleri(islemler.SonKargoIDAl(), islemler.RastgeleKuryeIDAl(), "Kargo oluştu");

            islemler.KargoHareketEkle(yeniHareket);
        }