Exemplo n.º 1
0
        //public void UrunTipleriGetir(ComboBox liste)
        //{
        //    liste.Items.Clear();
        //    SqlCommand comm = new SqlCommand("Select * from UrunTipleri where Silindi=0", conn);
        //    if (conn.State == ConnectionState.Closed) conn.Open();
        //    SqlDataReader dr;
        //    dr = comm.ExecuteReader();
        //    if (dr.HasRows)
        //    {
        //        while (dr.Read())
        //        {
        //            liste.Items.Add(dr["TipAd"].ToString());
        //        }
        //        dr.Close();
        //    }
        //    conn.Close();
        //}
        public void UrunTipleriGetir(ComboBox liste)
        {
            liste.Items.Clear();
            SqlCommand comm = new SqlCommand("Select * from UrunTipleri where Silindi=0", conn);
            if (conn.State == ConnectionState.Closed) conn.Open();
            SqlDataReader dr;
            dr = comm.ExecuteReader();
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    cUrunTip ot = new cUrunTip();
                    ot._urunTipID = Convert.ToInt32(dr["UrunTipID"]);
                    ot._tipAd = dr["TipAd"].ToString();
                    liste.Items.Add(ot);

                }
                dr.Close();
            }
            conn.Close();
        }
Exemplo n.º 2
0
        private void Urunler_Load(object sender, EventArgs e)
        {
            cUrunTip ut = new cUrunTip();
            ut.UrunTipleriGetir(cbUrunTipi);

            ut.UrunTipleriGetir(cbUrunTipineGore);  // tipe gore arama için
            ut.UrunTipleriGetir(cbTureGore);  // 3.sayfa türleri getirmek için

            cUrun u = new cUrun();
            u.UrunleriGetir(lvUrunler);  // 1.sayfa urunler listesi
            u.UrunAdlariGetir(cbUrunAd);  // 2.sayfa için ürün adlar

            txtTarih.Text = DateTime.Now.ToShortDateString();

            cUrunHareket uh = new cUrunHareket();
            uh.UrunHareketleriGetir(lvStokHareket, uh.UrunID);
            uh.UrunHareketlerinHepsiniGetir(lvStokHareket); // sayfa 2 stokhareket listesi

            //cbUrunAd.Items.Insert(0, "Tüm Ürünler");
        }
Exemplo n.º 3
0
 private void txtUrunAdaGore2_TextChanged(object sender, EventArgs e)
 {
     cUrunTip ot = new cUrunTip();
     ds = ot.UrunleriGetirByAdaGore2(txtUrunAdaGore2.Text);
     dgvStok.DataSource = ds.Tables["Stok"];
     int ToplamMiktar = 0;
     double ToplamTutar = 0;
     foreach (DataRow dr in ds.Tables["Stok"].Rows)
     {
         ToplamMiktar += Convert.ToInt32(dr["Miktar"]);
         ToplamTutar += Convert.ToDouble(dr["Tutar"]);
     }
     txtToplamMiktar.Text = ToplamMiktar.ToString();
     txtToplamTutar.Text = string.Format("{0:C}", ToplamTutar);
     GridViewDuzenle();
     dgvStok.Columns["UrunAd"].Width = 225;
     dgvStok.Columns["Tutar"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
 }
Exemplo n.º 4
0
 private void txtUrunAdaGore_TextChanged(object sender, EventArgs e)
 {
     cUrunTip ot = new cUrunTip();
     ot.UrunleriGetirByAdaGore(lvUrunler, txtUrunAdaGore.Text);
 }
Exemplo n.º 5
0
 private void cbUrunTipineGore_SelectedIndexChanged(object sender, EventArgs e)
 {
     cUrunTip ot = new cUrunTip();
     ot.UrunleriGetirByTipeGore(lvUrunler, cbUrunTipineGore.SelectedItem.ToString());
 }