Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportCashAdv rpt = new CrystalReportCashAdv();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        public void panggilTampilCA(CrystalReportCashAdv crca)
        {
            FormTampilReport f = new FormTampilReport();

            f.crca      = crca;
            f.MdiParent = this;
            f.Show();
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         CrystalReportCashAdv cr = new CrystalReportCashAdv();
         cr.SetParameterValue("noca", labelKodeCA.Text);
         ((FormParent)this.MdiParent).panggilTampilCA(cr);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 4
0
 private void DataGridViewCA_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridViewCA.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "Edit" && (dataGridViewCA.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewDisableButtonCell).Enabled)
     {
         ((FormParent)this.MdiParent).panggilCA(dataGridViewCA.Rows[e.RowIndex].Cells[0].Value.ToString(), 4);
     }
     if (dataGridViewCA.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "Cetak" && (dataGridViewCA.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewDisableButtonCell).Enabled)
     {
         CrystalReportCashAdv cr = new CrystalReportCashAdv();
         cr.SetParameterValue("noca", dataGridViewCA.Rows[e.RowIndex].Cells[0].Value.ToString());
         ((FormParent)this.MdiParent).panggilTampilCA(cr);
     }
     if (dataGridViewCA.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "Delete" && (dataGridViewCA.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewDisableButtonCell).Enabled)
     {
         if (MessageBox.Show("Apakah anda yakin ingin mendelete CA dengan tujuan : '" + dataGridViewCA.Rows[e.RowIndex].Cells[5].Value.ToString() + "' ?", "Confirm", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             try
             {
                 if (ClassConnection.Instance().Connecting())
                 {
                     string       commandText = "DELETE FROM pettyca WHERE kode = @kode";
                     MySqlCommand cmd         = new MySqlCommand(commandText, ClassConnection.Instance().Connection);
                     cmd.Parameters.AddWithValue("@kode", dataGridViewCA.Rows[e.RowIndex].Cells[0].Value.ToString());
                     int rowsAffected = cmd.ExecuteNonQuery();
                     MessageBox.Show("Data telah terhapus", "Berhasil");
                     ClassConnection.Instance().Close();
                     (this.MdiParent as FormParent).updateDGVCAAEPO();
                 }
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message, "Error");
             }
         }
     }
 }