Exemplo n.º 1
0
        public bool FilmSatisAdetGuncelle(FilmSatis fs)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update FilmSatis set Adet=@Adet,BirimFiyat=@BirimFiyat Where SatisNo=@SatisNo", conn);

            comm.Parameters.Add("@Adet", SqlDbType.Int).Value         = fs.Adet;
            comm.Parameters.Add("@SatisNo", SqlDbType.Int).Value      = fs.SatisNo;
            comm.Parameters.Add("@BirimFiyat", SqlDbType.Money).Value = fs.BirimFiyat;

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            try
            {
                Sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally
            {
                conn.Close();
            }
            return(Sonuc);
        }
Exemplo n.º 2
0
        public bool SatisKaydet(FilmSatis fs)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Insert into FilmSatis (Tarih,FilmNo,MusteriNo,Adet,BirimFiyat) values(@Tarih,@FilmNo,@MusteriNo,@Adet,@BirimFiyat)", conn);

            comm.Parameters.Add("@Tarih", SqlDbType.DateTime).Value   = fs.Tarih;
            comm.Parameters.Add("@FilmNo", SqlDbType.Int).Value       = fs.FilmNo;
            comm.Parameters.Add("@MusteriNo", SqlDbType.Int).Value    = fs.MusteriNo;
            comm.Parameters.Add("@Adet", SqlDbType.Int).Value         = fs.Adet;
            comm.Parameters.Add("@BirimFiyat", SqlDbType.Money).Value = fs.BirimFiyat;

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            try
            {
                Sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException e)
            {
                string mesaj = e.Message;
            }
            finally
            {
                conn.Close();
            }
            return(Sonuc);
        }
Exemplo n.º 3
0
        public bool SatisSil(FilmSatis fs)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update FilmSatis set Silindi=1 Where SatisNo=@SatisNo", conn);

            comm.Parameters.Add("@SatisNo", SqlDbType.Int).Value = fs.SatisNo;

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            try
            {
                Sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally
            {
                conn.Close();
            }
            return(Sonuc);
        }
Exemplo n.º 4
0
        private void frmFilmSatis_Load(object sender, EventArgs e)
        {
            this.Top  = 0;
            this.Left = 0;

            txtTarih.Text = DateTime.Now.ToShortDateString();
            FilmSatis fs = new Model.FilmSatis();

            fs.SatislariGoster(lvSatislar, txtToplamAdet, txtToplamTutar);
        }