Disable Preloader

This is first sample how to code in .NET.
Just have a look!.

 Sub ShowData(ByVal vIDGrupHarga As String, ByVal vKey As String)

        Dim vSQL As String = String.Empty
        If vIDGrupHarga = "000" Then
            vSQL = "a1.id_barang,a.nama_barang_lengkap as nama_barang,aa.nama_kategori,b.jenis_barang,a.acc_asset,a.acc_hpp_biaya,a.acc_income," & _
                 "c.hpp," & _
                 "a.hrg_jual1 AS hrg_jual "
        Else
            vSQL = "a1.id_barang,a.nama_barang_lengkap as nama_barang,aa.nama_kategori,b.jenis_barang,a.acc_asset,a.acc_hpp_biaya,a.acc_income," & _
                 "c.hpp," & _
                 "(c.hpp * " & var_TaxBeli & " * " & GetMarkUpJual(vIDGrupHarga) & ") as hrg_jual "

        End If

        Dim vTable As String = "tbl_barang_lokasi a1 " & _
                 "LEFT JOIN tbl_barang a ON a.id_barang=a1.id_barang " & _
                 "LEFT JOIN tbl_barang_kategori aa ON a.id_kategori=aa.id_kategori " & _
                 "LEFT JOIN tbl_barang_jenis b ON a.id_jenis=b.id_jenis " & _
                 "LEFT JOIN view_barang_hpp c ON a.id_barang=c.id_barang"

        Dim vKriteria As String = ""
        Dim vOrderBy As String = ""
        Dim vGroupBy As String = "a1.id_barang"


        If vKey = vbNullString Then
            vKriteria = "a1.id_lokasi=" & CInt(var_IDRUanganSystem)
            vGroupBy = "a1.id_barang"
        Else
            vKriteria = "a1.id_lokasi=" & CInt(var_IDRUanganSystem) & " and a.nama_barang_lengkap LIKE '%" & vKey & "%' "
            vGroupBy = "a1.id_barang"
        End If
        Me.Cursor = Cursors.WaitCursor
        Pager = New KlikEngine.Paging(klik, "a.id_barang", vSQL, vTable, LabelPageSize, ComboPageSize, GridControl1)
        Pager.RunPaging(vKriteria, vGroupBy, vOrderBy)
        Me.Cursor = Cursors.Default

    End Sub

 

Share:
admin

Semua manusia memiliki kesempatan yang sama, jadi tetap semangat untuk melakukan pekerjaan sebaik mungkin.

Comments