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 btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         addMuzekkere();
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 3
0
 private void dgv_cevaplar_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         getEkler();
         btnAddEk.Enabled = true;
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 public frmViewKesinti(int kisiNo)
 {
     try
     {
         InitializeComponent();
         this.kisiNo = kisiNo;
         loadKesintiler();
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 5
0
 public frmCevapYaziları(int IcraKayıtNumarası)
 {
     try
     {
         InitializeComponent();
         this.IcraKayıtNumarası = IcraKayıtNumarası;
         getCevaplar();
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 private void btnaddKesinti_Click(object sender, EventArgs e)
 {
     try
     {
         if (tBoxBakiye.Text != "" && cBoxAlacak.SelectedIndex != 0)
         {
             addKesinti();
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 private void fillCBoxKurumlar()
 {
     try
     {
         DataTable dt = this.getKurumListesi();
         cBoxKurumlar.DataSource    = dt;
         cBoxKurumlar.DisplayMember = "Kurum Adı";
         cBoxKurumlar.ValueMember   = "Kurum Numarası";
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 8
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     { if (cevapDosyaYolu != "" && tBox_evrak_sayısı.Text != "")
       {
           addCevap();
           getCevaplar();
       }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 9
0
 private void frmIcralar_Load(object sender, EventArgs e)
 {
     try
     {
         if (kisiNo != 0)
         {
             loadPersonel();
             getIcralar();
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 10
0
 private void frmCevapYaziları_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         string FILEPATH = Environment.ExpandEnvironmentVariables("%APPDATA%\\PersonelIcraTakipProgrami\\tmp");
         if (Directory.Exists(FILEPATH))
         {
             Directory.Delete(FILEPATH, true);
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 private void frm_addPersonel_Load(object sender, EventArgs e)
 {
     try
     {
         if (tboxKisiNo.Text != "")
         {
             fillCBoxKurumlar();
             loadPersonel(Convert.ToInt32(tboxKisiNo.Text));
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 12
0
 private void btnOpenEk_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog openFile = new OpenFileDialog();
         openFile.Filter           = "PDF Dosyası |*.pdf|UDF Dosyası |*.udf|JPEG Dosyası |*.jpg";
         openFile.RestoreDirectory = true;
         if (openFile.ShowDialog() == DialogResult.OK)
         {
             ekDosyaYolu = openFile.FileName;
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 13
0
 public addIcra()
 {
     try
     {
         InitializeComponent();
         LoadIcraDairesi();
         LoadAlacak();
         LoadIcraTuru();
         dgvBorclular.DataSource      = prepareBorcluDGV();
         dgvAlacak.DataSource         = prepareAlacakDGV();
         dgvAlacak.Columns[0].Visible = false;
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 private void btnOpenFile_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog openFile = new OpenFileDialog();
         openFile.Filter           = "PDF Dosyası | *.pdf";
         openFile.RestoreDirectory = true;
         if (openFile.ShowDialog() == DialogResult.OK)
         {
             pdfViewer.LoadFromFile(openFile.FileName);
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (checkAlreadySaved(Convert.ToInt32(tboxKisiNo.Text)))
         {
             updatePersonel();
         }
         else
         {
             addPersonel();
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
 private void dgv_muzekkereler_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         int           kayitNo = Convert.ToInt32(dgv_muzekkereler.Rows[e.RowIndex].Cells[0].Value);
         NpgsqlCommand command = new NpgsqlCommand();
         command.CommandText = "select  \"goruntu\", \"dosya_uzantantisi\" from tb_muzekkereler where kayitno =  @kayitno_";
         command.Parameters.AddWithValue("@kayitno_", NpgsqlTypes.NpgsqlDbType.Integer, kayitNo);
         DataTable dt = dbConnection.getData(command);
         if (dt.Rows.Count > 0)
         {
             byte[]       byteArray = (byte[])dt.Rows[0][0];
             MemoryStream stream    = new MemoryStream(byteArray);
             pdfViewer.LoadFromStream(stream);
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
        private DataTable getKurumListesi()
        {
            DataTable dt = new DataTable();

            try
            {
                NpgsqlCommand command = new NpgsqlCommand();
                string        sql     = "SELECT kk5 as \"Kurum Numarası\", adi as \"Kurum Adı\" FROM public.tb_kurumlar";
                command.CommandText = sql;
                dt = dbConnection.getData(command);
                DataRow dr = dt.NewRow();
                dr[0] = -1;
                dr[1] = "";
                dt.Rows.InsertAt(dr, 0);
            }
            catch (Exception ex)
            {
                MessageBoxs.ErrorMessage(ex);
            }
            return(dt);
        }
Ejemplo n.º 18
0
 private void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvAlacak.Rows.Count == 0 || dgvBorclular.Rows.Count == 0)
         {
             MessageBoxs.WarningMessage("Dikkat borçlu veya kesinti yapılabilecek alacak şeçilmemiş.");
             return;
         }
         if (this.IcraKayitNo != 0)
         {
             UpdateIcra2DB();
         }
         else
         {
             addIcra2DB();
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }
Ejemplo n.º 19
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     try
     {
         int           kayitNo = Convert.ToInt32(dgv_ekler.SelectedRows[0].Cells[0].Value);
         NpgsqlCommand command = new NpgsqlCommand();
         command.CommandText = "select  \"goruntu\", \"dosya_uzantisi\", \"aciklama\" from tb_cevaplar_ekler  where kayitno =  @kayitno_";
         command.Parameters.AddWithValue("@kayitno_", NpgsqlTypes.NpgsqlDbType.Integer, kayitNo);
         DataTable dt = dbConnection.getData(command);
         if (dt.Rows.Count > 0)
         {
             string FILEPATH = Environment.ExpandEnvironmentVariables("%APPDATA%\\PersonelIcraTakipProgrami\\tmp");
             Directory.CreateDirectory(FILEPATH);
             FILEPATH += "\\" + kayitNo + "_" + dt.Rows[0][2].ToString() + "_" + DateTime.Now.Year + "_" + DateTime.Now.Month + "_" + DateTime.Now.Day + "_" + DateTime.Now.Millisecond + "." + dt.Rows[0][1].ToString();
             byte[] byteArray = (byte[])dt.Rows[0][0];
             saveFile(byteArray, FILEPATH);
             Process.Start(FILEPATH);
         }
     }
     catch (Exception ex)
     {
         MessageBoxs.ErrorMessage(ex);
     }
 }