Пример #1
0
        private void txtTcNo_TextChanged(object sender, EventArgs e)
        {
            cSatis s = new cSatis();

            dgvSatislar.DataSource = s.SatisGetir(txtTcNo.Text);
            GridViewDuzenle();
        }
Пример #2
0
        public bool satisEkle(cSatis s)
        {
            bool          sonuc = false;
            SqlConnection conn  = new SqlConnection(gnl.connStr);
            SqlCommand    comm  = new SqlCommand("SatisEkle", conn);

            comm.CommandType = CommandType.StoredProcedure;

            comm.Parameters.Add("@mid", SqlDbType.Int).Value = s.Mid;
            comm.Parameters.Add("@uid", SqlDbType.Int).Value = s.Uid;
            comm.Parameters.Add("@pid", SqlDbType.Int).Value = s.Pid;

            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);
        }
Пример #3
0
        private void frmSatisSorgulama_Load(object sender, EventArgs e)
        {
            cSatis s = new cSatis();

            dgvSatislar.DataSource = s.SatisGetir();
            GridViewDuzenle();
        }
Пример #4
0
        private void txtnereye_TextChanged(object sender, EventArgs e)
        {
            cSatis s = new cSatis();

            int kapasite = Convert.ToInt32(cGenel.kontenjan);

            kapasite -= s.satisCount(Convert.ToInt32(cGenel.ucusID));
            s.SatisGetir(lvSatislar, Convert.ToInt32(cGenel.ucusID));
            txtKontenjan.Text = kapasite.ToString();
        }
Пример #5
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (txtUcusID.Text != "" && txtMusteriID.Text != "")
     {
         cSatis s = new cSatis();
         s.Mid = Convert.ToInt32(txtMusteriID.Text);
         s.Pid = frmAnaSayfa.logmain.PersonelID;
         s.Uid = Convert.ToInt32(txtUcusID.Text);
         bool sonuc = s.satisEkle(s);
         if (sonuc)
         {
             MessageBox.Show("İşlem Gerçekleti");
             int kapasite = Convert.ToInt32(cGenel.kontenjan);
             kapasite -= s.satisCount(Convert.ToInt32(cGenel.ucusID));
             s.SatisGetir(lvSatislar, Convert.ToInt32(cGenel.ucusID));
             txtKontenjan.Text = kapasite.ToString();
         }
     }
 }
Пример #6
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            cSatis s = new cSatis();

            if (MessageBox.Show("Silmek İstiyor musunuz?", "SİLİNSİN Mİ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                bool sonuc = s.satisSil(Convert.ToInt32(dgvSatislar.SelectedRows[0].Cells[4].Value));
                if (sonuc)
                {
                    MessageBox.Show("Silinmiştir.");
                    dgvSatislar.DataSource = s.SatisGetir();
                    txtTcNo.Clear();
                }
                else
                {
                    MessageBox.Show("Silinemedi.");
                }
            }
        }
Пример #7
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     if (txtUcusID.Text != "" && txtMusteriID.Text != "")
     {
         cSatis s = new cSatis();
         s.Mid = Convert.ToInt32(txtMusteriID.Text);
         s.Pid = frmAnaSayfa.logmain.PersonelID;
         s.Uid = Convert.ToInt32(txtUcusID.Text);
         bool sonuc = s.satisEkle(s);
         if (sonuc)
         {
             MessageBox.Show("İşlem Gerçekleti");
             int kapasite = Convert.ToInt32(cGenel.kontenjan);
             kapasite -= s.satisCount(Convert.ToInt32(cGenel.ucusID));
             s.SatisGetir(lvSatislar, Convert.ToInt32(cGenel.ucusID));
             txtKontenjan.Text = kapasite.ToString();
         }
     }
 }
Пример #8
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            cSatis s = new cSatis();

            if (MessageBox.Show("Silmek İstiyor musunuz?", "SİLİNSİN Mİ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                bool sonuc =  s.satisSil(Convert.ToInt32(dgvSatislar.SelectedRows[0].Cells[4].Value));
                if (sonuc)
                {
                    MessageBox.Show("Silinmiştir.");
                    dgvSatislar.DataSource = s.SatisGetir();
                    txtTcNo.Clear();
                }
                else
                {
                    MessageBox.Show("Silinemedi.");
                }

            }
        }
Пример #9
0
        public bool satisEkle(cSatis s)
        {
            bool sonuc = false;
            SqlConnection conn = new SqlConnection(gnl.connStr);
            SqlCommand comm = new SqlCommand("SatisEkle", conn);
            comm.CommandType = CommandType.StoredProcedure;

            comm.Parameters.Add("@mid", SqlDbType.Int).Value = s.Mid;
            comm.Parameters.Add("@uid", SqlDbType.Int).Value = s.Uid;
            comm.Parameters.Add("@pid", SqlDbType.Int).Value = s.Pid;

            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;
        }
Пример #10
0
        private void txtKtarihi_TextChanged(object sender, EventArgs e)
        {
            cSatis s = new cSatis();

            int kapasite = Convert.ToInt32(cGenel.kontenjan);
            kapasite -= s.satisCount(Convert.ToInt32(cGenel.ucusID));
            s.SatisGetir(lvSatislar, Convert.ToInt32(cGenel.ucusID));
            txtKontenjan.Text = kapasite.ToString();
        }
Пример #11
0
 private void txtTcNo_TextChanged(object sender, EventArgs e)
 {
     cSatis s = new cSatis();
     dgvSatislar.DataSource = s.SatisGetir(txtTcNo.Text);
     GridViewDuzenle();
 }
Пример #12
0
 private void frmSatisSorgulama_Load(object sender, EventArgs e)
 {
     cSatis s = new cSatis();
     dgvSatislar.DataSource = s.SatisGetir();
     GridViewDuzenle();
 }