Beispiel #1
0
        private void addIcra2DB()
        {
            try
            {
                decimal bakiye = parayaCevir(tBoxBakiye.Text);
                if (bakiye > 0)
                {
                    NpgsqlCommand command = new NpgsqlCommand();
                    command.CommandText = "select addIcra(@esasno , @tarih , @icra_dairesi, @tutar_ , @icraturu, @borclu , @alacak, @oncelik, @sabit_kesinti);";
                    command.Parameters.AddWithValue("@esasno", NpgsqlTypes.NpgsqlDbType.Text, tBoxEsasNo.Text);
                    command.Parameters.AddWithValue("@tarih", NpgsqlTypes.NpgsqlDbType.Date, Date_date.Value);

                    command.Parameters.AddWithValue("@icra_dairesi", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(cBox_İcraDairesi.SelectedValue));

                    command.Parameters.AddWithValue("@tutar_", NpgsqlTypes.NpgsqlDbType.Money, bakiye);

                    command.Parameters.AddWithValue("@sabit_kesinti", NpgsqlTypes.NpgsqlDbType.Money, parayaCevir(tBox_sabit_kesinti.Text));

                    command.Parameters.AddWithValue("@icraturu", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(cBox_IcraTuru.SelectedValue));
                    command.Parameters.AddWithValue("@oncelik", NpgsqlTypes.NpgsqlDbType.Boolean, cBox_Oncelik.Checked);
                    command.Parameters.AddWithValue("@borclu", NpgsqlTypes.NpgsqlDbType.Array | NpgsqlTypes.NpgsqlDbType.Integer, getBorclu());
                    command.Parameters.AddWithValue("@alacak", NpgsqlTypes.NpgsqlDbType.Array | NpgsqlTypes.NpgsqlDbType.Integer, getAlacak());
                    // command.CommandType = CommandType.StoredProcedure;
                    dbConnection.sendQuery(command);
                    MessageBoxs.SuccessMessage("İcra Dosyası Oluşturma Başarılı");
                    clear();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog save = new SaveFileDialog();
                save.Filter = "PDF Dosyası | *.pdf";
                if (save.ShowDialog() == DialogResult.OK)
                {
                    MemoryStream stream = new MemoryStream();

                    pdfViewer.SaveToFile(stream);
                    byte[] bytesInStream = new byte[stream.Length];
                    bytesInStream = stream.ToArray();

                    FileStream fileStream = new FileStream(save.FileName, FileMode.Create, FileAccess.Write);
                    stream.CopyTo(fileStream);
                    fileStream.Write(bytesInStream, 0, bytesInStream.Length);
                    fileStream.Close();
                }
                MessageBoxs.SuccessMessage("Dosya Kaydedildi");
            }
            catch (Exception ex)
            {
                MessageBoxs.ErrorMessage(ex);
            }
        }
 private void addMuzekkere()
 {
     try
     {
         NpgsqlCommand command = new NpgsqlCommand();
         command.CommandText = "INSERT INTO tb_muzekkereler (\"gelistarihi\", \"icra\", \"goruntu\", \"dosya_uzantantisi\") VALUES (@tarih, @kayitno , @goruntu , @uzantı);";
         command.Parameters.AddWithValue("@kayitno", NpgsqlTypes.NpgsqlDbType.Integer, this.IcraKayitNo);
         command.Parameters.AddWithValue("@tarih", NpgsqlTypes.NpgsqlDbType.Date, Date_date.Value);
         command.Parameters.AddWithValue("@goruntu", NpgsqlTypes.NpgsqlDbType.Bytea, File.ReadAllBytes(pdfViewer.FileName));
         command.Parameters.AddWithValue("@uzantı", NpgsqlTypes.NpgsqlDbType.Varchar, "pdf");
         dbConnection.sendQuery(command);
         MessageBoxs.SuccessMessage("Müzekkere eklendi");
         loadMuzekkere();
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #4
0
 private void addCevap()
 {
     try
     {
         NpgsqlCommand command = new NpgsqlCommand();
         command.CommandText = "INSERT INTO tb_cevaplar VALUES (default, @kayitno, @tarih, @evraksayisi, @goruntu, @uzantı); ";
         command.Parameters.AddWithValue("@kayitno", NpgsqlTypes.NpgsqlDbType.Integer, IcraKayıtNumarası);
         command.Parameters.AddWithValue("@tarih", NpgsqlTypes.NpgsqlDbType.Date, Date_date.Value);
         command.Parameters.AddWithValue("@evraksayisi", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(tBox_evrak_sayısı.Text));
         command.Parameters.AddWithValue("@goruntu", NpgsqlTypes.NpgsqlDbType.Bytea, File.ReadAllBytes(cevapDosyaYolu));
         command.Parameters.AddWithValue("@uzantı", NpgsqlTypes.NpgsqlDbType.Varchar, getFileExtension(cevapDosyaYolu));
         dbConnection.sendQuery(command);
         cevapDosyaYolu = "";
         MessageBoxs.SuccessMessage("Evrak Sisteme Başarıyla Eklendi");
     }
     catch (Exception)
     {
         throw;
     }
 }
 private void addPersonel()
 {
     try
     {
         NpgsqlCommand command = new NpgsqlCommand();
         command.CommandText = "INSERT INTO public.tb_personel (kisi_no, tc_no, adı, soyadı, ckurum) VALUES (@kisino, @tcno, @adı, @soyadı, @ckurum)";
         command.Parameters.AddWithValue("@kisino", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(tboxKisiNo.Text));
         command.Parameters.AddWithValue("@tcno", NpgsqlTypes.NpgsqlDbType.Bigint, Convert.ToDecimal(tBoxTCNo.Text));
         command.Parameters.AddWithValue("@adı", NpgsqlTypes.NpgsqlDbType.Text, tBoxAdi.Text);
         command.Parameters.AddWithValue("@soyadı", NpgsqlTypes.NpgsqlDbType.Text, tBoxSoyadi.Text);
         command.Parameters.AddWithValue("@ckurum", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(cBoxKurumlar.SelectedValue));
         dbConnection.sendQuery(command);
         tboxKisiNo.Enabled = false;
         tBoxTCNo.Enabled   = false;
         MessageBoxs.SuccessMessage("Kişi Oluşturma Başarılı");
     }
     catch (Exception)
     {
         throw;
     }
 }
        private void updatePersonel()
        {
            try
            {
                NpgsqlCommand command = new NpgsqlCommand();
                command.CommandText = "UPDATE public.tb_personel SET  adı=@adı, soyadı=@soyadı, ckurum=@ckurum WHERE kisi_no=@kisino";
                command.Parameters.AddWithValue("@kisino", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(tboxKisiNo.Text));
                command.Parameters.AddWithValue("@adı", NpgsqlTypes.NpgsqlDbType.Text, tBoxAdi.Text);
                command.Parameters.AddWithValue("@soyadı", NpgsqlTypes.NpgsqlDbType.Text, tBoxSoyadi.Text);
                command.Parameters.AddWithValue("@ckurum", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(cBoxKurumlar.SelectedValue));
                dbConnection.sendQuery(command);
                tboxKisiNo.Enabled = false;
                tBoxTCNo.Enabled   = false;

                MessageBoxs.SuccessMessage("Kişi Güncelleme Başarılı");
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #7
0
 private void addEk()
 {
     try
     {
         NpgsqlCommand command = new NpgsqlCommand();
         command.CommandText = "INSERT INTO tb_cevaplar_ekler (kayitno, yazıno, goruntu, dosya_uzantisi, aciklama) VALUES (default, @yazino, @goruntu, @uzantı, @aciklama); ";
         command.Parameters.AddWithValue("@yazino", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(dgv_cevaplar.SelectedRows[0].Cells[0].Value));
         command.Parameters.AddWithValue("@goruntu", NpgsqlTypes.NpgsqlDbType.Bytea, File.ReadAllBytes(ekDosyaYolu));
         command.Parameters.AddWithValue("@uzantı", NpgsqlTypes.NpgsqlDbType.Varchar, getFileExtension(ekDosyaYolu));
         command.Parameters.AddWithValue("@aciklama", NpgsqlTypes.NpgsqlDbType.Text, richTox_ek_aciklama.Text);
         dbConnection.sendQuery(command);
         ekDosyaYolu = "";
         richTox_ek_aciklama.Text = "";
         MessageBoxs.SuccessMessage("Evrak Eki Sisteme Başarıyla Eklendi");
         getEkler();
     }
     catch (Exception)
     {
         throw;
     }
 }
 private void addKesinti()
 {
     try
     {
         decimal bakiye = parayaCevir(tBoxBakiye.Text);
         if (bakiye > 0)
         {
             NpgsqlCommand command = new NpgsqlCommand();
             command.CommandText = "INSERT INTO tb_kesintiler VALUES (default, @kisi, @icra, @tur, @tarih, @tutar);";
             command.Parameters.AddWithValue("@tutar", NpgsqlTypes.NpgsqlDbType.Money, bakiye);
             command.Parameters.AddWithValue("@tarih", NpgsqlTypes.NpgsqlDbType.Date, Date_date.Value);
             command.Parameters.AddWithValue("@tur", NpgsqlTypes.NpgsqlDbType.Integer, Convert.ToInt32(cBoxAlacak.SelectedValue));
             command.Parameters.AddWithValue("@kisi", NpgsqlTypes.NpgsqlDbType.Integer, KisiNo);
             command.Parameters.AddWithValue("@icra", NpgsqlTypes.NpgsqlDbType.Integer, IcraNo);
             dbConnection.sendQuery(command);
             MessageBoxs.SuccessMessage("Kesinti Sisteme Eklendi");
             this.Close();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }