private void txtTcNo_TextChanged(object sender, EventArgs e) { cSatis s = new cSatis(); dgvSatislar.DataSource = s.SatisGetir(txtTcNo.Text); GridViewDuzenle(); }
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); }
private void frmSatisSorgulama_Load(object sender, EventArgs e) { cSatis s = new cSatis(); dgvSatislar.DataSource = s.SatisGetir(); GridViewDuzenle(); }
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(); }
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(); } } }
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."); } } }
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; }
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(); }