private void StokListeyiYukle()
        {
            //if (txtArama.Text == "") // bu olmayınca ufak bi sıkıntısı vardı geçti
            //{
            //    StokListe.Arama = "";
            //}
            try
            {
                //if (StokListe.dtStok.Rows.Count != 0)
                {
                    gcUrunListesi.DataSource = StokListe.StokAra(SqlConnections.GetAresUTSqlConnection());
                }
                if (gvUrunListesi.SelectedRowsCount == 0)
                {
                    pictureEdit1.EditValue = null;
                    lblFiyati.Text         = "";
                    lblRafyeri.Text        = "";
                    lblStokAdi.Text        = "";
                    return;
                }
                AlanlariYenidenBinle();

                gvResimYukle();
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void AresUTSil() // önceki vt yi siliyor
        {
            SqlTransaction Tr = SqlConnections.GetAresUTSqlConnection().BeginTransaction();

            SqlCommand cmd = new SqlCommand("USE AresUrunTanitim delete from Stok  delete from Resim", SqlConnections.GetAresUTSqlConnection(), Tr);

            cmd.ExecuteNonQuery();
            Tr.Commit();
        }
Exemple #3
0
        private void frmUrunListesi_Load(object sender, EventArgs e)
        {
            BaglantiAres   = SqlConnections.GetAresSqlConnection();
            BaglantiAresUT = SqlConnections.GetAresUTSqlConnection();

            if (BaglantiAres.State == ConnectionState.Closed)
            {
                BaglantiAres.Open();
            }
            if (BaglantiAresUT.State == ConnectionState.Closed)
            {
                BaglantiAresUT.Open();
            }

            GridDoldur();
        }
        private void frmAnaFormParametre_Load(object sender, EventArgs e)
        {
            XmlOku();


            BaglantiAres   = SqlConnections.GetAresSqlConnection();
            BaglantiAresUT = SqlConnections.GetAresUTSqlConnection();

            if (BaglantiAres.State == ConnectionState.Closed)
            {
                BaglantiAres.Open();
            }
            if (BaglantiAresUT.State == ConnectionState.Closed)
            {
                BaglantiAresUT.Open();
            }

            FiyatTanimlariniGetir();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                BaglantiAres   = SqlConnections.GetAresSqlConnection();
                BaglantiAresUT = SqlConnections.GetAresUTSqlConnection();

                if (BaglantiAres.State == ConnectionState.Closed)
                {
                    BaglantiAres.Open();
                }
                if (BaglantiAresUT.State == ConnectionState.Closed)
                {
                    BaglantiAresUT.Open();
                }

                StokListe = new csStok(SqlConnections.GetAresUTSqlConnection());


                txtArama_TextChanged(null, null);
                gvResimYukle();



                txtArama.DataBindings.Add("EditValue", StokListe, "Arama", true, DataSourceUpdateMode.OnPropertyChanged);


                AlanlariYenidenBinle();

                timer1.Start();
            }
            catch (Exception hata)
            {
                MessageBox.Show(hata.Message);
            }
        }
        private void gvResimYukle()
        {
            if (gvUrunListesi.SelectedRowsCount > 0)
            {
                da = new SqlDataAdapter("select * from Resim where StokID = @StokID", SqlConnections.GetAresUTSqlConnection());
                da.SelectCommand.Parameters.Add("@StokID", SqlDbType.Int).Value = gvUrunListesi.GetFocusedRowCellValue("StokID");
                dtResim = new DataTable();
                da.Fill(dtResim);
                gcResimler.DataSource = dtResim;

                if (dtResim.Rows.Count > 0)
                {
                    pictureEdit1.DataBindings.Clear();
                    pictureEdit1.DataBindings.Add("EditValue", dtResim, "Resim", true, DataSourceUpdateMode.OnPropertyChanged);
                }
                else
                {
                    pictureEdit1.DataBindings.Clear();
                    pictureEdit1.EditValue = null;
                }
            }
        }