Пример #1
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled)
     {
     }
     else if (e.Error != null)
     {
         Msg           = "Error";
         Progress.Text = Msg;
         Error.LogError(e.Error);
         progressBar1.Value = 0;
         cmdSearch.PerformClick();
     }
     else
     {
         Msg                = "Succes";
         Progress.Text      = Msg;
         progressBar1.Value = 100;
         cmdSearch.PerformClick();
     }
     cmdYes.Enabled    = true;
     cmdSearch.Enabled = true;
     cmdSearch.PerformClick();
     dtHeaderA.Rows.Clear();
     dtHeaderB.Rows.Clear();
     dtHeaderC.Rows.Clear();
     dtHeaderD.Rows.Clear();
     dtHeaderE.Rows.Clear();
     GvHeaderA.DataSource = dtHeaderA.DefaultView; GvHeaderA.Refresh();
     GVHeaderB.DataSource = dtHeaderB.DefaultView; GVHeaderB.Refresh();
     GVHeaderC.DataSource = dtHeaderC.DefaultView; GVHeaderC.Refresh();
     GVHeaderD.DataSource = dtHeaderD.DefaultView; GVHeaderD.Refresh();
     GVHeaderE.DataSource = dtHeaderE.DefaultView; GVHeaderE.Refresh();
 }
Пример #2
0
 private void cmdSearch_Click(object sender, EventArgs e)
 {
     if (!rangeDateBox1.FromDate.HasValue || !rangeDateBox1.ToDate.HasValue)
     {
         Error.ErrorMessage(rangeDateBox1, "isi");
         return;
     }
     if (GlobalVar.PerusahaanRowID != GlobalVar.GetPT.SAP)
     {
         MessageBox.Show("Hanya Untuk login SAP");
         this.Close();
         return;
     }
     try
     {
         this.Cursor = Cursors.WaitCursor;
         DateTime FromDate = rangeDateBox1.FromDate.Value;
         DateTime ToDate   = rangeDateBox1.ToDate.Value;
         Guid     PT       = (Guid)cboPers.SelectedValue;
         dtHeaderA = JournalPS.dtNota(FromDate, ToDate, PT);
         dtHeaderB = JournalPS.dtRetur(FromDate, ToDate, PT);
         dtHeaderC = JournalPS.dtKPJ(FromDate, ToDate, PT);
         dtHeaderD = JournalPS.dtKRJ(FromDate, ToDate, PT);
         dtHeaderE = JournalPS.dtIden(FromDate, ToDate, PT);
         GvHeaderA.AutoGenerateColumns = true;
         GVHeaderB.AutoGenerateColumns = true;
         GVHeaderC.AutoGenerateColumns = true;
         GVHeaderD.AutoGenerateColumns = true;
         GVHeaderE.AutoGenerateColumns = true;
         GvHeaderA.DataSource          = dtHeaderA.DefaultView; GvHeaderA.Refresh();
         GVHeaderB.DataSource          = dtHeaderB.DefaultView; GVHeaderB.Refresh();
         GVHeaderC.DataSource          = dtHeaderC.DefaultView; GVHeaderC.Refresh();
         GVHeaderD.DataSource          = dtHeaderD.DefaultView; GVHeaderD.Refresh();
         GVHeaderE.DataSource          = dtHeaderE.DefaultView; GVHeaderE.Refresh();
         foreach (TabPage TB in TabJournal.TabPages)
         {
             foreach (Control ctrX in TB.Controls)
             {
                 if (ctrX is ISA.Controls.CustomGridView)
                 {
                     ISA.Controls.CustomGridView ctr = (ISA.Controls.CustomGridView)ctrX;
                     foreach (DataGridViewColumn col in ctr.Columns)
                     {
                         if (col.Name.Contains("Row"))
                         {
                             col.Visible = false;
                         }
                         if (col.Name.Contains("HeaderID"))
                         {
                             col.Visible = false;
                         }
                         if (col.Name.Contains("RecordID"))
                         {
                             col.Visible = false;
                         }
                         if (col.Name.Contains("Tanggal") || col.Name.Contains("Tgl"))
                         {
                             col.DefaultCellStyle.Format = "dd-MM-yyyy";
                         }
                         if (col.Name.Contains("Rp") || col.Name.Contains("Amount") || col.Name.Contains("Nominal"))
                         {
                             col.DefaultCellStyle.Format    = "N2";
                             col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                         }
                         if (col.Name.Contains("F"))
                         {
                             col.DefaultCellStyle.Format    = "N2";
                             col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                         }
                         if (col.Name.Contains("NoPer"))
                         {
                             col.Visible = false;
                         }
                     }
                 }
             }
         }
     }
     catch (System.Exception ex)
     {
         Error.LogError(ex);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }