Пример #1
0
 private void BtnKayitIptal_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("İşlemi İptal etmek istediğinizden eminmisiniz ?", "İptal Edilsinmi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         MusteriBosalt();
         GbxMusteriBilgi.Enabled = false;
         GbxMusteriler.Enabled   = true;
         TxtAraMNO.Focus();
     }
 }
Пример #2
0
 private void Musteri_Load(object sender, EventArgs e)
 {
     ComboBoxlariDoldur();
     GridDoldur();
     TxtAraMNO.Focus();
 }
Пример #3
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            if (KayitKontrol())
            {
                SqlParameter[] pCollection = new SqlParameter[]
                {
                    new SqlParameter("@ID", SqlDbType.Int),
                    new SqlParameter("@Unvan", SqlDbType.NVarChar, 150),
                    new SqlParameter("@Adres", SqlDbType.NVarChar, 250),
                    new SqlParameter("@Tel", SqlDbType.NVarChar, 15),
                    new SqlParameter("@Cep", SqlDbType.NVarChar, 15),
                    new SqlParameter("@Fax", SqlDbType.NVarChar, 15),
                    new SqlParameter("@SehirID", SqlDbType.Int),
                    new SqlParameter("@IlceID", SqlDbType.Int),
                    new SqlParameter("@SemtID", SqlDbType.Int),
                    new SqlParameter("@OperatorID", SqlDbType.Int),
                    new SqlParameter("@VergiDairesi", SqlDbType.NVarChar, 50),
                    new SqlParameter("@VergiNo", SqlDbType.NVarChar, 50),
                    new SqlParameter("@FirmaYetkili", SqlDbType.NVarChar, 150),
                    new SqlParameter("@Aciklama", SqlDbType.NVarChar, 500),
                    new SqlParameter("@AktifMi", SqlDbType.Bit),
                    new SqlParameter("@OpID", SqlDbType.Int),
                    new SqlParameter("@GuncellemeTarihi", SqlDbType.SmallDateTime),
                };
                foreach (SqlParameter x in pCollection)
                {
                    x.Value = DBNull.Value;
                }
                pCollection[0].Value  = int.Parse(TxtMusteriNo.Text);
                pCollection[1].Value  = TxtUnvan.Text;
                pCollection[2].Value  = TxtAdres.Text;
                pCollection[3].Value  = TxtTelefon.Text;
                pCollection[4].Value  = TxtCep.Text;
                pCollection[5].Value  = TxtFax.Text;
                pCollection[6].Value  = int.Parse(((ListItem)CbxSehir.SelectedItem).ID);
                pCollection[7].Value  = int.Parse(((ListItem)CbxIlce.SelectedItem).ID);
                pCollection[8].Value  = int.Parse(((ListItem)CbxSemt.SelectedItem).ID);
                pCollection[9].Value  = int.Parse(((ListItem)CbxOperator.SelectedItem).ID);
                pCollection[10].Value = TxtVD.Text;
                pCollection[11].Value = TxtVNO.Text;
                pCollection[12].Value = TxtYetkili.Text;
                pCollection[13].Value = TxtAciklama.Text;
                pCollection[14].Value = ChkBxAktif.Checked;
                pCollection[15].Value = AnaFrm.OpID;
                pCollection[16].Value = DateTime.Now;

                if (YeniMi)
                {
                    if (AKBclass.DBMudahale.SQLIsle("INSERT INTO Musteri_Tbl(Unvan,Adres,Tel,Cep,Fax,SehirID,IlceID,SemtID,OperatorID,VergiDairesi,VergiNo,FirmaYetkili,Aciklama,AktifMi,OpID,GuncellemeTarihi) VALUES (@Unvan,@Adres,@Tel,@Cep,@Fax,@SehirID,@IlceID,@SemtID,@OperatorID,@VergiDairesi,@VergiNo,@FirmaYetkili,@Aciklama,@AktifMi,@OpID,@GuncellemeTarihi)", pCollection) != "-1")
                    {
                        MessageBox.Show("Müşteri Kaydedildi...", "Kayıt Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("İşlem sırasında hata oluştu !", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    if (AKBclass.DBMudahale.SQLIsle("UPDATE Musteri_Tbl SET Unvan = @Unvan,Adres = @Adres,Tel = @Tel,Cep = @Cep,Fax = @Fax,SehirID = @SehirID,IlceID = @IlceID,SemtID = @SemtID,OperatorID = @OperatorID,VergiDairesi = @VergiDairesi,VergiNo = @VergiNo,FirmaYetkili = @FirmaYetkili,Aciklama = @Aciklama,AktifMi = @AktifMi,OpID = @OpID,GuncellemeTarihi = @GuncellemeTarihi WHERE ID = @ID", pCollection) != "-1")
                    {
                        MessageBox.Show("Müşteri Güncellendi...", "Güncelleme Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("İşlem sırasında hata oluştu !", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }


                GbxMusteriBilgi.Enabled = false;
                GbxMusteriler.Enabled   = true;
                TxtAraMNO.Focus();
                GridDoldur();
            }
        }
Пример #4
0
 private void Musteri_Activated(object sender, EventArgs e)
 {
     TxtAraMNO.Focus();
 }