Exemplo n.º 1
0
        private void btnSiparisKoduOlustur_Click(object sender, EventArgs e)
        {
            try
            {
                sqlCmd = new SqlCommand("SELECT TOP 1 SIPARIS_INCKEY FROM SIPARIS ORDER BY SIPARIS_INCKEY DESC", Program.connection);
                SqlDataReader sqlReader = sqlCmd.ExecuteReader();
                if (sqlReader.HasRows)
                {
                    ActionControl.ActionAllControls(this, "clear");
                    siparisListesiGridView.Rows.Clear();
                    siparisListesiGridView.Refresh();
                    txtSiparisTarih.Text       = DateTime.Now.ToString("dd.MM.yyyy");
                    txtSiparisTeslimTarih.Text = DateTime.Now.ToString("dd.MM.yyyy");

                    sqlReader.Read();
                    txtSiparisKodu.Text = "SP" + (int.Parse(sqlReader["SIPARIS_INCKEY"].ToString()) + 1).ToString("D10");
                    siparisKod          = txtSiparisKodu.Text;
                    sqlReader.Close();
                }
                else
                {
                    txtSiparisKodu.Text = "SP0000000001";
                }
            }
            catch (Exception ex)
            {
                Notification.messageBoxError(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            ActionControl.ActionAllControls(groupBox1, "clear");
            ActionControl.ActionAllControls(groupBox2, "clear");
            ActionControl.ActionAllControls(groupBox3, "clear");
            ActionControl.ActionAllControls(groupBox4, "clear");

            cbStokDepo.Items.Clear();
            siparisListesiGridView.Rows.Clear();
            siparisStokList.Clear();

            siparisTipi.SelectedIndex  = 0;
            txtSiparisTarih.Text       = DateTime.Now.ToString("dd.MM.yyyy");
            txtSiparisTeslimTarih.Text = DateTime.Now.ToString("dd.MM.yyyy");
        }
Exemplo n.º 3
0
 private void silBttn_Click(object sender, EventArgs e)
 {
     if (kullaniciListesiGridView.SelectedRows.Count == 1)
     {
         try
         {
             DialogResult dialogResult = MessageBox.Show("SİLMEK İSTEDİĞİNİZDEN EMİN MİSİNİZ ?", "UYARI", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 int        kullaniciId = Int32.Parse(kullaniciListesiGridView.SelectedRows[0].Cells[0].Value.ToString());
                 SqlCommand command     = new SqlCommand("DELETE FROM KULLANICI WHERE KUL_INCKEY = @kul_inckey", Program.connection);
                 command.Parameters.Add("@kul_inckey", SqlDbType.Int).Value = kullaniciId;
                 int affectedRows = command.ExecuteNonQuery();
                 if (affectedRows > 0)
                 {
                     kullaniciListesiGridView.Rows.RemoveAt(selectedItem.Item1);
                     ActionControl.ActionAllControls(this, "clear");
                     textTemizle();
                     Notification.messageBox("Kullanıcı Başarıyla Silindi");
                 }
                 else
                 {
                     Notification.messageBoxError("Bir sorun oluştu, kullanıcı silinemedi !");
                 }
             }
         }
         catch (Exception ex)
         {
             Notification.messageBoxError(ex.Source);
         }
     }
     else
     {
         Notification.messageBoxError("Seçili bir kayıt bulunamadı !");
     }
 }
Exemplo n.º 4
0
 private void CariListeleDuzenle_Load(object sender, EventArgs e)
 {
     ActionControl.ActionAllControls(groupBox1, "disable");
 }
Exemplo n.º 5
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     ActionControl.ActionAllControls(this, "clear");
 }
Exemplo n.º 6
0
        private void txtCariKod_TextChanged(object sender, EventArgs e)
        {
            ActionControl.ActionAllControls(groupBox1, "enable");

            try
            {
                sqlCmd = new SqlCommand("SELECT * FROM CARI WHERE CARI_INCKEY=@cari_inckey", Program.connection);
                sqlCmd.Parameters.AddWithValue("@cari_inckey", secilenCari.Item1);
                SqlDataReader sqlReader = sqlCmd.ExecuteReader();
                sqlReader.Read();

                if (!String.IsNullOrEmpty(sqlReader["TC_NO"].ToString().Trim()))
                {
                    gercekKisiRadio.Checked = true;
                    tuzelKisiRadio.Checked  = false;

                    txtVergiDaire.Enabled  = false;
                    txtVergiDaire.ReadOnly = true;
                    txtVergiNo.Enabled     = false;
                    txtVergiNo.ReadOnly    = true;
                    txtTcKimlik.Enabled    = true;
                    txtTcKimlik.ReadOnly   = false;
                }
                else
                {
                    tuzelKisiRadio.Checked  = true;
                    gercekKisiRadio.Checked = false;

                    txtTcKimlik.Enabled    = false;
                    txtTcKimlik.ReadOnly   = true;
                    txtVergiDaire.Enabled  = true;
                    txtVergiDaire.ReadOnly = false;
                    txtVergiNo.Enabled     = true;
                    txtVergiNo.ReadOnly    = false;
                }

                txtTicariUnvan.Text = sqlReader["TICARI_UNVAN"].ToString();
                txtAdSoyad.Text     = sqlReader["ADSOYAD"].ToString();
                txtTcKimlik.Text    = sqlReader["TC_NO"].ToString();
                txtIl.Text          = sqlReader["IL"].ToString();
                txtIlce.Text        = sqlReader["ILCE"].ToString();
                txtVergiDaire.Text  = sqlReader["VERGI_DAIRE"].ToString();
                txtVergiNo.Text     = sqlReader["VERGI_NO"].ToString();
                txtEposta.Text      = sqlReader["EPOSTA"].ToString();
                txtTelefonNo.Text   = sqlReader["TEL_NO"].ToString();
                txtFaxNo.Text       = sqlReader["FAX_NO"].ToString();
                txtAdres.Text       = sqlReader["ADRES"].ToString();

                if (bool.Parse(sqlReader["CARI_DURUM"].ToString()))
                {
                    hesapDurumuAktif.Checked = true;
                    hesapDurumuPasif.Checked = false;
                }
                else
                {
                    hesapDurumuAktif.Checked = false;
                    hesapDurumuPasif.Checked = true;
                }
            }
            catch (Exception ex)
            {
                Notification.messageBoxError(ex.Message);
            }
        }
Exemplo n.º 7
0
 private void temizleBttn_Click(object sender, EventArgs e)
 {
     ActionControl.ActionAllControls(this, "clear");
 }
Exemplo n.º 8
0
        private void btnListeyeEkle_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtStokKodu.Text) || String.IsNullOrEmpty(txtBirimFiyat.Text))
            {
                Notification.messageBoxError("LÜTFEN STOK SEÇİNİZ");
            }
            else
            {
                if (decimal.Parse(txtToplamFiyat.Text) > 0)
                {
                    string stokDepoInckey = "";
                    string stokInckey     = "";
                    string stokKodu       = "";
                    string stokAdi        = "";
                    string stokMiktar     = "";
                    string stokBirim      = "";
                    string stokBirimFiyat = "";
                    string stokTutar      = "";
                    string stokDepo       = "";

                    if (stokGuncelle.Item1)
                    {
                        siparisListesiGridView.Rows.RemoveAt(stokGuncelle.Item2);

                        stokDepoInckey = selectedUpdateItem.Item1.ToString();
                        stokInckey     = selectedUpdateItem.Item2.ToString();
                        stokKodu       = txtStokKodu.Text.Trim();
                        stokAdi        = txtStokAdi.Text.Trim();
                        stokDepo       = cbStokDepo.SelectedItem.ToString().Split('-')[1].Trim();
                        stokMiktar     = txtStokMiktar.Text.Trim();
                        stokBirim      = txtStokBirim.Text.Trim();
                        stokBirimFiyat = txtBirimFiyat.Text.Trim();
                        stokTutar      = txtToplamFiyat.Text.Trim();


                        siparisListesiGridView.Rows.Add(stokDepoInckey, stokInckey, stokKodu, stokAdi, stokDepo, stokMiktar, stokBirim, stokBirimFiyat, stokTutar);
                        siparisToplamTutar += decimal.Parse(stokTutar);
                        siparisStokList.Add(stokInckey);

                        btnListeyeEkle.Text = "LİSTEYE EKLE";
                        ActionControl.ActionAllControls(groupBox4, "clear");
                        cbStokDepo.Items.Clear();
                    }
                    else
                    {
                        if (!siparisStokList.Contains(selectedItem.Item2["STOK_INCKEY"].Value.ToString()))
                        {
                            stokDepoInckey = cbStokDepo.SelectedItem.ToString().Split('-')[0].Trim();
                            stokInckey     = selectedItem.Item2["STOK_INCKEY"].Value.ToString();
                            stokKodu       = txtStokKodu.Text.Trim();
                            stokAdi        = selectedItem.Item2["STOK_ADI"].Value.ToString();
                            stokMiktar     = txtStokMiktar.Text;
                            stokBirim      = txtStokBirim.Text;
                            stokBirimFiyat = selectedItem.Item2["BIRIM_FIYAT"].Value.ToString();
                            stokTutar      = txtToplamFiyat.Text;
                            stokDepo       = cbStokDepo.SelectedItem.ToString().Split('-')[1].Trim();

                            siparisListesiGridView.Rows.Add(stokDepoInckey, stokInckey, stokKodu, stokAdi, stokDepo, stokMiktar, stokBirim, stokBirimFiyat, stokTutar);
                            siparisStokList.Add(selectedItem.Item2["STOK_INCKEY"].Value.ToString());
                            siparisToplamTutar += decimal.Parse(stokTutar);

                            kaydetBttn.Enabled = true;
                            ActionControl.ActionAllControls(groupBox4, "clear");
                            cbStokDepo.Items.Clear();
                        }
                    }

                    siparisListesiGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                }
            }
        }