You are on page 1of 25

MODULE

Imports System.Data.SqlClient
Module Module1
Public constr As Strin ! "Interated Security!SSPI#Persist
Security In$o!%alse#Initial Catalo!I&D'A#Data Source!(local)"
Public conn As SqlConnection
Public data As SqlDataAdapter
Public dset As Dataset1
Public $*arya+an As %rm*arya+an
Public $absen* As $rmabsensi*eluar
Public $absenm As $rmabsensimasu*
Public $lembur As %rmlembur
Public $loin As %rmloin
Public $pena,ian As %orm-Pena,ian
Public $t.r As %orm-/0'
Public $a,i As %orm-Pena,ian
Public $utama As %rmmenuutama

End Module
Imports System.Data.SqlClient
Public Class $rmabsensi*eluar
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub /imer3-/ic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles /imer3./ic*
lbl/anal./e7t ! %ormat(&o+6 "dd 8 MMM 8 yyyy")
lbl9am./e7t ! %ormat(&o+6 "..:mm:ss")
End Sub
Pri2ate Sub cmdSearc.-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles cmdSearc..Clic*
Dim $ As &e+ %rm*arya+an
$.4utton1.5isible ! %alse
$.4utton3.5isible ! %alse
$.4utton;.5isible ! %alse
$.4utton<.5isible ! %alse
$.panil ! "=eluar"
$.S.o+()
End Sub
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim com As &e+ SqlCommand
/ry
com.Connection ! conn
conn.Open()
com.Command/e7t ! "update tb-absensi set ,am-*eluar!>" ?
lbl9am./e7t ? "> +.ere *ode-*arya+an!>" ? t7t=ode./e7t ? "> and
/anal!>" ? %ormat(&o+6 "MM8dd8yyyy") ? ">"
com.E7ecute&on@uery()
conn.Close()
Ms4o7("Data /ela. Disimpan")
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
Catc. e7 As E7ception
Messae4o7.S.o+("=arya+an /ersebut Suda. Absensi")
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
End /ry
End Sub
Pri2ate Sub $rmabsensi*eluar-Load(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub $rmabsensi*eluar-Closin(4y5al sender As Ob,ect6 4y5al
e As System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$absen* ! &ot.in
End Sub
End Class
Imports System.Data.SqlClient
Public Class $rmabsensimasu*
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub tmr,ammasu*-/ic*(4y5al sender As Ob,ect6 4y5al e As
System.E2entArs) 0andles tmr,ammasu*./ic*
lbl/anal./e7t ! %ormat(&o+6 "dd 8 MMM 8 yyyy")
lbl9am./e7t ! %ormat(&o+6 "..:mm:ss")
End Sub
Pri2ate Sub cmdSearc.-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles cmdSearc..Clic*
Dim $ As &e+ %rm*arya+an
$.4utton1.5isible ! %alse
$.4utton3.5isible ! %alse
$.4utton;.5isible ! %alse
$.4utton<.5isible ! %alse
$.panil ! "Masu*"
$.S.o+()
End Sub
Pri2ate Sub $rmabsensimasu*-Load(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim com As &e+ SqlCommand
/ry
com.Connection ! conn
conn.Open()
com.Command/e7t ! "Insert into tb-absensi 2alues(>" ?
t7t=ode./e7t ? ">6>" ? %ormat(&o+6 "MM8dd8yyyy") ? ">6>" ? lbl9am./e7t
? ">6>A>6B6>>)"
com.E7ecute&on@uery()
conn.Close()
Ms4o7("Data /ela. Disimpan")
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
Catc. e7 As E7ception
Messae4o7.S.o+("=arya+an /ersebut Suda. Absensi")
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
End /ry

End Sub
Pri2ate Sub $rmabsensimasu*-Closin(4y5al sender As Ob,ect6 4y5al e
As System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$absenm ! &ot.in
End Sub
End Class
Imports System.Data.SqlClient
Public Class %rm*arya+an
In.erits System.1indo+s.%orms.%orm
Dim d2 As &e+ Data5ie+
Public panil As Strin
Pri2ate Sub %rm*arya+an-Load(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles My4ase.Load
CmbSearc..Items.Add("*d-=arya+an")
CmbSearc..Items.Add("&ama")
CmbSearc..Items.Add(",abatan")
/ry
conn ! &e+ SqlConnection(constr)
data ! &e+ SqlDataAdapter("selectC$rom tb-*arya+an"6 conn)
dset ! &e+ Dataset1
data.%ill(dset.tb-*arya+an)
d2./able ! dset.tb-*arya+an
tabel.DataSource ! d2
Catc. e7 As E7ception
Messae4o7.S.o+(e7.Messae)
End /ry

End Sub
Sub cari()
d2.'o+%ilter ! CmbSearc..SelectedItem ? " li*e >" ?
t7tSearc../e7t ? "D>"
End Sub
Pri2ate Sub 4utton1-Clic*-1(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles 4utton1.Clic*
Dim $s* As &e+ $ormtamba.*arya+an
Dim total As IntE<
Dim *ode As Strin
Dim n As Strin
n ! total
$s*.isinsert ! /rue
d2.'o+%ilter ! ""
/ry
total ! CInt(CStr(tabel.Item(tabel.5isible'o+Count A 36
B)).Substrin(16 ;)) F 1
Catc. e7 As E7ception
Messae4o7.S.o+(e7.Messae)
End /ry
I$ total G 1B /.en
*ode ! "=BB" ? total
ElseI$ total H 1B /.en
*ode ! "=B" ? total
ElseI$ total H 1I /.en
*ode ! "=B" ? n F 1
Else
*ode ! "=" ? total
End I$
$s*.t7t*ode*arya+an./e7t ! *ode
$s*.S.o+()
End Sub
Pri2ate Sub %rm*arya+an-Closed(4y5al sender As Ob,ect6 4y5al e As
System.E2entArs) 0andles My4ase.Closed
$*arya+an ! &ot.in
End Sub
Pri2ate Sub 4utton<-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton<.Clic*
Me.Close()
End Sub
Pri2ate Sub tabel-&a2iate(4y5al sender As System.Ob,ect6 4y5al ne
As System.1indo+s.%orms.&a2iateE2entArs) 0andles tabel.&a2iate
End Sub
Pri2ate Sub 4utton;-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton;.Clic*
Dim *ode As Strin
*ode ! tabel.Item(tabel.Current'o+Inde76 B)
Dim datar+ As Data'o+ ! dset.tb-*arya+an.%ind4y*d-*arya+an(*ode)
Dim $s* As &e+ $ormtamba.*arya+an
$s*.t7t*ode*arya+an./e7t ! datar+(B)
$s*.t7tnam./e7t ! datar+(1)
$s*.t7ttempatla.ir./e7t ! datar+(3)
$s*.dtptlLa.ir./e7t ! datar+(;)
$s*.t7talamat./e7t ! datar+(<)
$s*.t7ttelpon./e7t ! datar+(J)
$s*.t7t.p./e7t ! datar+(E)
I$ datar+(K) ! "Pria" /.en
$s*.rdopria.C.ec*ed ! /rue
Else
$s*.rdo+anita.C.ec*ed ! /rue
End I$
I$ datar+(L) ! "islam" /.en
$s*.rdoislam.C.ec*ed ! /rue
ElseI$ datar+(L) ! "protestan" /.en
$s*.rdoprotestan.C.ec*ed ! /rue
ElseI$ datar+(L) ! "*atoli*" /.en
$s*.rdo*atoli*.C.ec*ed ! /rue
ElseI$ datar+(L) ! "bud.a" /.en
$s*.rdobud.a.C.ec*ed ! /rue
ElseI$ datar+(L) ! ".indu" /.en
$s*.rdo.indu.C.ec*ed ! /rue
End I$
I$ datar+(I) ! "/=8A" /.en
$s*.rdot*.C.ec*ed ! /rue
ElseI$ datar+(I) ! "/=81" /.en
$s*.rdot*1.C.ec*ed ! /rue
ElseI$ datar+(I) ! "/=83" /.en
$s*.rdot*3.C.ec*ed ! /rue
ElseI$ datar+(I) ! "/=8;" /.en
$s*.rdot*;.C.ec*ed ! /rue
ElseI$ datar+(I) ! "=8A" /.en
$s*.rdo=.C.ec*ed ! /rue
ElseI$ datar+(I) ! "=81" /.en
$s*.rdo*1.C.ec*ed ! /rue
ElseI$ datar+(I) ! "=83" /.en
$s*.rdo*3.C.ec*ed ! /rue
ElseI$ datar+(I) ! "=8;" /.en
$s*.rdo*;.C.ec*ed ! /rue
End I$
$s*.dtptlMasu*.5alue ! datar+(1B)
$s*.t7t,abatan./e7t ! datar+(11)
$s*.t7ta,ipo*o*./e7t ! datar+(13)
$s*.t7tu$unsional./e7t ! datar+(1;)
$s*.t7tutransport./e7t ! datar+(1<)
$s*.t7tuma*an./e7t ! datar+(1J)
$s*.t7tt,amsoste*./e7t ! datar+(1E)
$s*.t7ttpa,a*./e7t ! datar+(1K)
$s*.t7ttll./e7t ! datar+(1L)
$s*.t7tulembur./e7t ! datar+(1I)
$s*./e7t4o71./e7t ! datar+(3B)
$s*.isinsert ! %alse
$s*.S.o+()
$s*.t7t*ode*arya+an.'eadOnly ! /rue
End Sub
Pri2ate Sub 4utton3-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton3.Clic*
Dim *ode As Strin
*ode ! tabel.Item(tabel.Current'o+Inde76 B)
Dim datar+ As Data'o+ ! dset.tb-*arya+an.%ind4y*d-*arya+an(*ode)
I$ Messae4o7.S.o+("Anda Ma*in N"6 "Con$irmation"6
Messae4o74uttons.Mes&o) ! Dialo'esult.Mes /.en
Dim com As &e+ SqlCommand
com.Connection ! conn
conn.Open()
com.Command/e7t ! "Delete $rom tb-*arya+an +.ere
*d-=arya+an!>" ? *ode ? ">"
com.E7ecute&on@uery()
dset.tb-*arya+an.'o+s.'emo2e(datar+)
Messae4o7.S.o+("Data tela. di.apus")
conn.Close()
End I$
End Sub
Pri2ate Sub btnCari-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles btnCari.Clic*
cari()
End Sub
Pri2ate Sub tabel-DoubleClic*(4y5al sender As Ob,ect6 4y5al e As
System.E2entArs) 0andles tabel.DoubleClic*
I$ panil ! "Masu*" /.en
$absenm.t7t=ode./e7t ! tabel.Item(tabel.Current'o+Inde76 B)
$absenm.t7t&ama./e7t ! tabel.Item(tabel.Current'o+Inde76 1)
panil ! ""
Me.Close()
End I$
I$ panil ! "=eluar" /.en
$absen*.t7t=ode./e7t ! tabel.Item(tabel.Current'o+Inde76 B)
$absen*.t7t&ama./e7t ! tabel.Item(tabel.Current'o+Inde76 1)
panil ! ""
Me.Close()
End I$
I$ panil ! "Lembur" /.en
$lembur.t7t=ode./e7t ! tabel.Item(tabel.Current'o+Inde76 B)
$lembur.t7t&ama./e7t ! tabel.Item(tabel.Current'o+Inde76 1)
panil ! ""
Me.Close()
End I$
I$ panil ! "/.r" /.en
$t.r.t7t=ode./e7t ! tabel.Item(tabel.Current'o+Inde76 B)
$t.r.t7t&ama./e7t ! tabel.Item(tabel.Current'o+Inde76 1)
panil ! ""
Me.Close()
End I$
I$ panil ! "Oa,i" /.en
$a,i.t7t=ode./e7t ! tabel.Item(tabel.Current'o+Inde76 B)
$a,i.t7t&ama./e7t ! tabel.Item(tabel.Current'o+Inde76 1)
$a,i.t7tStatusP/=P./e7t !
tabel.Item(tabel.Current'o+Inde76 I)
$a,i.t7tiuran,amsoste*./e7t !
tabel.Item(tabel.Current'o+Inde76 3B)
$a,i.t7ta,ipo*o*./e7t ! tabel.Item(tabel.Current'o+Inde76
13)
$a,i.t7tu$./e7t ! tabel.Item(tabel.Current'o+Inde76 1;)
$a,i.t7tut./e7t ! tabel.Item(tabel.Current'o+Inde76 1<)
$a,i.t7tum./e7t ! tabel.Item(tabel.Current'o+Inde76 1J)
$a,i.t7tt,./e7t ! tabel.Item(tabel.Current'o+Inde76 1E)
$a,i.t7ttp./e7t ! tabel.Item(tabel.Current'o+Inde76 1K)
$a,i.t7ttll./e7t ! tabel.Item(tabel.Current'o+Inde76 1L)
$a,i.t7ttari$lembur./e7t !
tabel.Item(tabel.Current'o+Inde76 1I)
panil ! ""
Me.Close()
End I$
End Sub
Pri2ate Sub %rm*arya+an-Closin(4y5al sender As Ob,ect6 4y5al e As
System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$*arya+an ! &ot.in
End Sub
End Class
Imports System.Data.SqlClient
Public Class %rmlembur
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub cmdSearc.-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles cmdSearc..Clic*
Dim $ As &e+ %rm*arya+an
$.4utton1.5isible ! %alse
$.4utton3.5isible ! %alse
$.4utton;.5isible ! %alse
$.4utton<.5isible ! %alse
$.panil ! "Lembur"
$.S.o+()
End Sub
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim com As &e+ SqlCommand
/ry
com.Connection ! conn
conn.Open()
com.Command/e7t ! "update tb-absensi set Lama-lembur!" ?
t7tLamaLembur./e7t ? "6Alasan-lembur!>" ? t7tAlasan./e7t ? "> +.ere
*ode-*arya+an!>" ? t7t=ode./e7t ? "> and /anal!>" ? %ormat(&o+6
"MM8dd8yyyy") ? ">"
com.E7ecute&on@uery()
conn.Close()
Ms4o7("Data tela. disimpan")
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
t7tLamaLembur./e7t ! ""
t7tAlasan./e7t ! ""
Catc. e7 As E7ception
Messae4o7.S.o+("=arya+an tersebut suda. absent")
t7tLamaLembur./e7t ! ""
/e7t4o71./e7t ! ""
End /ry
Me.Close()
End Sub
Pri2ate Sub 4utton3-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton3.Clic*
Me.Close()
End Sub
Pri2ate Sub t7tLamaLembur-/e7tC.aned(4y5al sender As
System.Ob,ect6 4y5al e As System.E2entArs) 0andles
t7tLamaLembur./e7tC.aned

End Sub
Pri2ate Sub %rmlembur-Load(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles My4ase.Load
End Sub


Pri2ate Sub /e7t4o71-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles /e7t4o71./e7tC.aned
Dim *er,a As Strin
>Dim .rbiasa As Strin
> .rbiasa ! 5al(t7tLamaLembur./e7t)
I$ rdo*er,a.C.ec*ed /.en
Select Case 5al(/e7t4o71./e7t)
Case Is H 1 : t7tLamaLembur./e7t ! (5al(/e7t4o71./e7t)
C 3) A B.J
Case Is G 3 : t7tLamaLembur./e7t ! 5al(/e7t4o71./e7t) C
1.J
End Select
E7it Sub
ElseI$ rdolibur.C.ec*ed /.en
Select Case 5al(/e7t4o71./e7t)
Case Is H 1B : Messae4o7.S.o+("batas ma*simal lembur
pada .ari libur adala. 1B ,am")
Case Is G L : t7tLamaLembur./e7t ! 5al(/e7t4o71./e7t) C
3
Case Is G I : t7tLamaLembur./e7t ! 1K
Case Is G 11 : t7tLamaLembur./e7t ! 31
Case Is G 11 : t7tLamaLembur./e7t ! 3J
End Select

End I$
I$ rdo*er,a.C.ec*ed /.en
t7tAlasan./e7t ! ".ari *er,a6 " ? 5al(/e7t4o71./e7t) ? "
,am lembur"
Else
t7tAlasan./e7t ! ".ari libur6 " ? 5al(/e7t4o71./e7t) ? "
,am lembur"
End I$
>Select Case 5al(t7ta,ipo*o*./e7t)
>
> Case Is H 31EBBBB : uan,abatan ! 1BLBBB
> Case Is G 31EBBBB : uan,abatan ! 5al(t7ta,ipo*o*./e7t) C
B.BJ
> End Select
End Sub
Pri2ate Sub rdolibur-C.ec*edC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles rdolibur.C.ec*edC.aned
t7tLamaLembur./e7t ! ""
/e7t4o71./e7t ! ""
End Sub
Pri2ate Sub rdo*er,a-C.ec*edC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles rdo*er,a.C.ec*edC.aned
t7tLamaLembur./e7t ! ""
/e7t4o71./e7t ! ""
End Sub
Pri2ate Sub %rmlembur-Closin(4y5al sender As Ob,ect6 4y5al e As
System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$lembur ! &ot.in
End Sub


End Class
Imports System.Data.SqlClient
Public Class %rmloin
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
I$ /e7t4o71./e7t ! "" /.en
Messae4o7.S.o+("nama .arus diisi")
%ocus()
E7it Sub
End I$
I$ /e7t4o73./e7t ! "" /.en
Messae4o7.S.o+("masu*an pass+ord anda")
%ocus()
ElseI$ /e7t4o73./e7t ! "*arya+an" /.en
Dim $mm As &e+ %rmmenuutama
$mm.mnabsensi.Enabled ! /rue
$mm.MenuItem3<.Enabled ! %alse
$mm.S.o+()
Me.Close()
ElseI$ /e7t4o73./e7t GH /e7t4o71./e7t /.en
Messae4o7.S.o+("pass+ord anda sala.")
%ocus()
E7it Sub
ElseI$ /e7t4o73./e7t ! /e7t4o73./e7t /.en
Dim $mm As &e+ %rmmenuutama
$mm.Mnmaster.Enabled ! /rue
$mm.mntransa*si.Enabled ! /rue
$mm.mnlaporan.Enabled ! /rue
$mm.mnabsensi.Enabled ! /rue
$mm.S.o+()
Me.Close()
End I$
>9i*a 2alidasi ber.asil masu* *e main menu
End Sub
Pri2ate Sub 4utton3-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton3.Clic*
Me.Close()
End Sub
Pri2ate Sub /e7t4o71-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles /e7t4o71./e7tC.aned
End Sub
Pri2ate Sub %rmloin-Load(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub %rmloin-Closin(4y5al sender As Ob,ect6 4y5al e As
System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$loin ! &ot.in
End Sub
End Class
Imports System.Data.SqlClient
Imports CrystalDecisions.Crystal'eports.Enine
Public Class %rmmenuutama
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub MenuItemE-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs)
End Sub
Pri2ate Sub MenuItem1K-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem1K.Clic*
Dim b As &e+ 'eportDocument
b.Load("lap a,i.rpt")
b.SetDatabaseLoon("sa"6 "sa"6 "."6 "I&D'A")
Dim $ As &e+ %orm-Laporan-Oa,i
$.Crystal'eport5ie+er3.'eportSource ! b
$.S.o+()
>Dim a As &e+ 'eportDocument
>a.Load("laporan *arya+an.rpt")
>> a.SetDatabaseLoon("sa"6 "e2o"6 "."6 "indra777")
> I$ cmb=ota.SelectedItem GH "All" /.en
>a.'ecordSelection%ormula ! "Ptb-*arya+an.tempat-la.irQ!>" ?
cmb=ota.SelectedItem ? ">"
> End I$
>a.'ecordSelection%ormula ! "Ptb-a,i.bulanQ!" ? t7tbulan.te7t
? " and Ptb-a,i.ta.unQ!" ? t7tta.un.te7t"
> Dim $ As &e+ $rmreport
> $.Crystal'eport5ie+er1.'eportSource ! a
> $.S.o+()

End Sub
Pri2ate Sub MenuItem3J-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem3J.Clic*
I$ $absenm Is &ot.in /.en $absenm ! &e+ $rmabsensimasu*
$absenm.S.o+()
>>masu* *e $orm absensi masu*
End Sub
Pri2ate Sub MenuItemE-Clic*-1(4y5al sender As System.Ob,ect6 4y5al
e As System.E2entArs) 0andles MenuItemE.Clic*
I$ $*arya+an Is &ot.in /.en
$*arya+an ! &e+ %rm*arya+an
End I$
$*arya+an.S.o+()
>>masu* *e $orm *arya+an
End Sub
Pri2ate Sub MenuItemL-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs)
Dim $ormedit*arya+an As &e+ $ormtamba.*arya+an
$ormedit*arya+an.S.o+()
>>masu* *e$orm tamba. *arya+an
End Sub
Pri2ate Sub MenuItem1L-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem1L.Clic*
I$ $a,i Is &ot.in /.en $a,i ! &e+ %orm-Pena,ian
$a,i.S.o+()
>Dim pa,ian As &e+ %orm-Pena,ian
>pa,ian.S.o+()
>>masu* *e$orm pena,ian
End Sub
Pri2ate Sub MenuItem3E-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem3E.Clic*
I$ $absen* Is &ot.in /.en $absen* ! &e+ $rmabsensi*eluar
$absen*.S.o+()
End Sub
Pri2ate Sub MenuItem11-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem11.Clic*
I$ $lembur Is &ot.in /.en $lembur ! &e+ %rmlembur
$lembur.S.o+()
>>masu* *e $orm lembur
End Sub
Pri2ate Sub MenuItem13-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem13.Clic*
Dim loin As &e+ %rmloin
loin.S.o+()
Me.0ide()
End Sub
Pri2ate Sub MenuItem1J-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem1J.Clic*
End
End Sub
Pri2ate Sub tmr,ammasu*-/ic*(4y5al sender As Ob,ect6 4y5al e As
System.E2entArs) 0andles /imer;./ic*
Label1./e7t ! /imeO$Day
End Sub
Pri2ate Sub Label1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles Label1.Clic*
End Sub
Pri2ate Sub MenuItem1-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem1.Clic*
Dim d As &e+ $rm%ilter'eport=arya+an
d.S.o+()
End Sub
Pri2ate Sub %rmmenuutama-Closin(4y5al sender As Ob,ect6 4y5al e As
System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$utama ! &ot.in
End Sub

Pri2ate Sub MenuItem;-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem;.Clic*
I$ $t.r Is &ot.in /.en $t.r ! &e+ %orm-/0'
$t.r.S.o+()
End Sub
Pri2ate Sub %rmmenuutama-Load(4y5al sender As System.Ob,ect6 4y5al
e As System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub MenuItem3B-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem3B.Clic*
Dim aa As &e+ %orm-sortir-absensi
aa.S.o+()
End Sub
Pri2ate Sub MenuItem31-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem31.Clic*
Dim R As &e+ %orm-Sortir-Lembur
R.S.o+()
End Sub
Pri2ate Sub MenuItem<-Clic*(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles MenuItem<.Clic*
Dim q As &e+ 'eportDocument
q.Load("slip a,i *arya+an.rpt")
q.SetDatabaseLoon("sa"6 "sa"6 "."6 "I&D'A")
Dim . As &e+ %orm-lap-/0'
..Crystal'eport5ie+erE.'eportSource ! q
..S.o+()

End Sub
Pri2ate Sub Picture4o71-Clic*(4y5al sender As System.Ob,ect6 4y5al
e As System.E2entArs) 0andles Picture4o71.Clic*
End Sub
Pri2ate Sub /e7t4o71-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs)
End Sub
End Class
Imports System.Data.SqlClient
Public Class %orm-Pena,ian
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub t7tt*-/e7tC.aned(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles t7tt*./e7tC.aned
Dim pt*p As Strin
pt*p ! t7tStatusP/=P./e7t
Dim a,ista.un As Double
Dim uanpt*p As Double
Dim .asil As Double
Dim uan,abatan As Double
Select Case 5al(t7ta,ipo*o*./e7t)
Case Is H 31EBBBB : uan,abatan ! 1BLBBB
Case Is G 31EBBBB : uan,abatan ! 5al(t7ta,ipo*o*./e7t) C
B.BJ
End Select
a,ista.un ! (5al(t7tt*./e7t) A uan,abatan) C 13
Select Case pt*p
Case "/=8A" : uanpt*p ! 1;3BBBBB
Case "/=81" : uanpt*p ! 1<<BBBBB
Case "/=83" : uanpt*p ! 1JEBBBBB
Case "/=8;" : uanpt*p ! 1ELBBBBB
Case "=8A" : uanpt*p ! 1<<BBBBB
Case "=81" : uanpt*p ! 1JEBBBBB
Case "=83" : uanpt*p ! 1ELBBBBB
Case "=8;" : uanpt*p ! 1LBBBBBB
End Select
.asil ! a,ista.un A uanpt*p
Select Case .asil
Case Is G B : .asil ! B
Case Is G 3JBBBBBB : .asil ! .asil C B.BJ
Case Is G JBBBBBBB : .asil ! (.asil A 3JBBBBBB) C B.1 F
13JBBBB
Case Is G 1BBBBBBBB : .asil ! (.asil A JBBBBBBB) C B.1J F
;KJBBBB
Case Is G 3BBBBBBBB : .asil ! (.asil A 1BBBBBBBB) C B.3J F
113JBBBB
Case Else : .asil ! (.asil A 3BBBBBBBB) C B.;J F ;E3JBBBB
End Select
t7tpp.31sebulan./e7t ! .asil 8 13
End Sub
Pri2ate Sub t7tul-/e7tC.aned(4y5al sender As System.Ob,ect6 4y5al
e As System.E2entArs) 0andles t7tul./e7tC.aned
I$ Len(t7t=ode./e7t) GH < /.en E7it Sub
t7tt*./e7t ! 5al(t7ta,ipo*o*./e7t) F 5al(t7tu$./e7t) F
5al(t7tut./e7t) F 5al(t7tum./e7t) F 5al(t7ttp./e7t) F 5al(t7ttll./e7t)
F 5al(t7tul./e7t) A 5al(t7tiuran,amsoste*./e7t)
/e7t4o71./e7t ! 5al(t7ta,ipo*o*./e7t) F 5al(t7tu$./e7t) F
5al(t7tut./e7t) F 5al(t7tum./e7t) F 5al(t7ttp./e7t) F 5al(t7ttll./e7t)
F 5al(t7tul./e7t) A (5al(t7tiuran,amsoste*./e7t) F
5al(t7tpp.31sebulan./e7t))
End Sub
Pri2ate Sub 4utton1-Clic*-1(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles btnsimpan.Clic*
>pa,a* per bulan menapdate *edalam database tb-a,i (pa,a*
pen.asilan)
Dim com As &e+ SqlCommand
/ry
>I$ conn.State ! ConnectionState.Open /.en conn.Close()
com.Connection ! conn
conn.Open()
com.Command/e7t ! "Insert into tb-a,i 2alues(>" ?
t7t=ode./e7t ? -
">6" ? %ormat(&o+6 "MM") ? "6" ?
%ormat(&o+6 "yyyy") ? -
"6" ? 5al(t7ta,ipo*o*./e7t) ? "6" ?
5al(t7tu$./e7t) ? -
"6" ? 5al(t7tut./e7t) ? "6" ?
5al(t7tum./e7t) ? -
"6" ? 5al(t7tt,./e7t) ? "6" ?
5al(t7ttp./e7t) ? -
"6" ? 5al(t7ttll./e7t) ? "6" ?
5al(t7tul./e7t) ? -
"6" ? 5al(t7tiuran,amsoste*./e7t) ? "6" ?
5al(t7tpp.31sebulan./e7t) ? -
"6" ? 5al(t7tt*./e7t) A
5al(t7tpp.31sebulan./e7t) ? ")"
com.E7ecute&on@uery()
conn.Close()
Messae4o7.S.o+("Data tela. disimpan")
%or Eac. a As Control In Me.Controls
I$ /ypeO$ (a) Is /e7t4o7 /.en
Dim 7 As /e7t4o7 ! a
7./e7t ! ""
End I$
&e7t
t7tt*./e7t ! ""
t7tpp.31sebulan./e7t ! ""
/e7t4o71./e7t ! ""
Catc. e7 As E7ception
I$ conn.State ! ConnectionState.Open /.en conn.Close()
Messae4o7.S.o+("/ela. menerima a,i bulan ini ") >6
e7.Messae )
%or Eac. a As Control In Me.Controls
I$ /ypeO$ (a) Is /e7t4o7 /.en
Dim 7 As /e7t4o7 ! a
7./e7t ! ""
End I$
&e7t
t7tt*./e7t ! ""
t7tpp.31sebulan./e7t ! ""
/e7t4o71./e7t ! ""
End /ry

Me.Close()
End Sub
Pri2ate Sub 4utton1-Clic*-3(4y5al sender As System.Ob,ect6 4y5al e
As System.E2entArs) 0andles 4utton1.Clic*
Dim $ As &e+ %rm*arya+an
$.4utton1.5isible ! %alse
$.4utton3.5isible ! %alse
$.4utton;.5isible ! %alse
$.4utton<.5isible ! %alse
$.panil ! "Oa,i"
$.S.o+()
End Sub
Pri2ate Sub t7t,umla.lembur-/e7tC.aned(4y5al sender As
System.Ob,ect6 4y5al e As System.E2entArs) 0andles
t7t,umla.lembur./e7tC.aned
t7tul./e7t ! 5al(t7t,umla.lembur./e7t) C
5al(t7ttari$lembur./e7t)
End Sub
Pri2ate Sub t7ttari$lembur-/e7tC.aned(4y5al sender As
System.Ob,ect6 4y5al e As System.E2entArs) 0andles
t7ttari$lembur./e7tC.aned
I$ Len(t7t=ode./e7t) GH < /.en E7it Sub
Dim com As &e+ SqlCommand
Dim lamalembur As Int1E
/ry
com.Connection ! conn
conn.Open()
com.Command/e7t ! "select sum(lama-lembur) as total $rom
tb-absensi +.ere *ode-*arya+an!>" ? t7t=ode./e7t ? "> and
mont.(/anal)!" ? &o+.Mont.
lamalembur ! com.E7ecuteScalar
conn.Close()
t7t,umla.lembur./e7t ! 5al(lamalembur)
Catc. e7 As E7ception
>Messae4o7.S.o+(e7.Messae)
t7t,umla.lembur./e7t ! B
End /ry
End Sub
Pri2ate Sub t7ta,ipo*o*-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles t7ta,ipo*o*./e7tC.aned6
t7tt*./e7tC.aned6 t7tu$./e7tC.aned6 t7tut./e7tC.aned6
t7tum./e7tC.aned6 t7tt,./e7tC.aned6 t7ttp./e7tC.aned6
t7ttll./e7tC.aned6 t7tul./e7tC.aned6 t7tiuran,amsoste*./e7tC.aned6
t7tpp.31sebulan./e7tC.aned
sender./e7t ! 5al(sender./e7t)
End Sub
Pri2ate Sub btnbatal-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles btnbatal.Clic*
Me.Close()
End Sub
Pri2ate Sub %orm-Pena,ian-Closin(4y5al sender As Ob,ect6 4y5al e
As System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$a,i ! &ot.in
End Sub
End Class
Imports CrystalDecisions.Crystal'eports.Enine
Public Class %orm-sortir-absensi
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim abse As &e+ 'eportDocument
abse.Load("lap absensi.rpt")
abse.SetDatabaseLoon("sa"6 "sa"6 "."6 "I&D'A")
>I$ /e7t4o71./e7t GH "" /.en
>abse.'ecordSelection%ormula ! "Ptb-absensi./analQ!>" ?
/e7t4o71./e7t ? ">"
>End I$
>a.'ecordSelection%ormula ! "Ptb-a,i.bulanQ!" ? t7tbulan.te7t
? " and Ptb-a,i.ta.unQ!" ? t7tta.un.te7t"
Dim asa As &e+ %orm-report-absensi
asa.Crystal'eport5ie+er;.'eportSource ! abse
asa.S.o+()
Me.Close()
End Sub
End Class
Imports CrystalDecisions.Crystal'eports.Enine
Public Class %orm-Sortir-Lembur
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim abc As &e+ 'eportDocument
abc.Load("lap lembur.rpt")
abc.SetDatabaseLoon("sa"6 "sa"6 "."6 "I&D'A")
>I$ /e7t4o71./e7t GH "" /.en
>abc.'ecordSelection%ormula ! "Ptb-absensi./analQ!>" ?
/e7t4o71./e7t ? ">"
>End I$
>a.'ecordSelection%ormula ! "Ptb-a,i.bulanQ!" ? t7tbulan.te7t
? " and Ptb-a,i.ta.unQ!" ? t7tta.un.te7t"
Dim sa As &e+ %orm-Lembur-=arya+an
sa.Crystal'eport5ie+er<.'eportSource ! abc
sa.S.o+()
Me.Close()
End Sub
End Class
Imports System.Data.SqlClient
Public Class $ormtamba.*arya+an
In.erits System.1indo+s.%orms.%orm
Public isinsert As 4oolean
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim aama As Strin
I$ rdoislam.C.ec*ed /.en
aama ! "islam"
ElseI$ rdoprotestan.C.ec*ed /.en
aama ! "protestan"
ElseI$ rdo*atoli*.C.ec*ed /.en
aama ! "*atoli*"
ElseI$ rdobud.a.C.ec*ed /.en
aama ! "bud.a"
ElseI$ rdo.indu.C.ec*ed /.en
aama ! ".indu"
End I$
Dim pt*p As Strin
I$ rdo=.C.ec*ed /.en
pt*p ! "=8A"
ElseI$ rdo*1.C.ec*ed /.en
pt*p ! "=81"
ElseI$ rdo*3.C.ec*ed /.en
pt*p ! "=83"
ElseI$ rdo*;.C.ec*ed /.en
pt*p ! "=8;"
ElseI$ rdot*.C.ec*ed /.en
pt*p ! "/=8A"
ElseI$ rdot*1.C.ec*ed /.en
pt*p ! "/=81"
ElseI$ rdot*3.C.ec*ed /.en
pt*p ! "/=83"
ElseI$ rdot*;.C.ec*ed /.en
End I$
/ry
Dim command As &e+ SqlCommand
command.Connection ! conn
I$ isinsert ! /rue /.en
command.Command/e7t ! " insert into tb-*arya+an
2alues(>" ? t7t*ode*arya+an./e7t ? -
">6>" ? t7tnam./e7t ? ">6>" ?
t7ttempatla.ir./e7t ? ">6>" ? -
dtptlLa.ir.5alue ? ">6>" ?
t7talamat./e7t ? ">6>" ? -
t7ttelpon./e7t ? ">6>" ?
t7t.p./e7t ? ">6>" ? II$(rdopria.C.ec*ed6 "Pria"6 "1anita") ? -
">6>" ? aama ? ">6>" ? -
pt*p ? ">6>" ? dtptlMasu*.5alue
? ">6>" ? t7t,abatan./e7t ? -
">6" ? t7ta,ipo*o*./e7t ? "6" ?
t7tu$unsional./e7t ? -
"6" ? t7tutransport./e7t ? "6" ?
t7tuma*an./e7t ? -
"6" ? t7tt,amsoste*./e7t ? "6" ?
t7ttpa,a*./e7t ? -
"6" ? t7ttll./e7t ? "6" ?
t7tulembur./e7t ? "6" ? /e7t4o71./e7t ? "6B6B)"
I$ conn.State ! ConnectionState.Open /.en conn.Close()
conn.Open()
command.E7ecute&on@uery()
conn.Close()
Dim datar+ As Data'o+ ! dset.tb-*arya+an.&e+'o+
datar+(B) ! t7t*ode*arya+an./e7t
datar+(1) ! t7tnam./e7t
datar+(3) ! t7ttempatla.ir./e7t
datar+(;) ! dtptlLa.ir.5alue
datar+(<) ! t7talamat./e7t
datar+(J) ! t7ttelpon./e7t
datar+(E) ! t7t.p./e7t
datar+(K) ! II$(rdopria.C.ec*ed6 "Pria"6 "1anita")
datar+(L) ! aama
datar+(I) ! pt*p
datar+(1B) ! dtptlMasu*.5alue
datar+(11) ! t7t,abatan./e7t
datar+(13) ! t7ta,ipo*o*./e7t
datar+(1;) ! t7tu$unsional./e7t
datar+(1<) ! t7tutransport./e7t
datar+(1J) ! t7tuma*an./e7t
datar+(1E) ! t7tt,amsoste*./e7t
datar+(1K) ! t7ttpa,a*./e7t
datar+(1L) ! t7ttll./e7t
datar+(1I) ! t7tulembur./e7t
datar+(3B) ! /e7t4o71./e7t
dset.tb-*arya+an.'o+s.Add(datar+)
Else
command.Command/e7t ! " update tb-*arya+an set nama!
>" ? t7tnam./e7t ? -
">6tempat-la.ir! >" ?
t7ttempatla.ir./e7t ? -
">6tanal-la.ir! >" ?
dtptlLa.ir.5alue ? -
" >6alamat! >" ?
t7talamat./e7t ? -
">6telepon! >" ?
t7ttelpon./e7t ? -
">6.p! >" ?
t7t.p./e7t ? -
">6,enis-*elamin! >" ?
II$(rdopria.C.ec*ed6 "Pria"6 "1anita") ? -
">6aama! >" ? aama
? -
">6status-pt*p! >" ? pt*p ?
-
">6tanal-masu*! >" ?
dtptlMasu*.5alue ? -
">6,abatan! >" ?
t7t,abatan./e7t ? -
">6a,i-po*o*! " ?
t7ta,ipo*o*./e7t ? -
"6uan-$unsional! " ?
t7tu$unsional./e7t ? -
"6uan-transport! " ?
t7tutransport./e7t ? -
"6uan-ma*an! " ?
t7tuma*an./e7t ? -
"6tun,anan-,amsoste*!" ?
t7tt,amsoste*./e7t ? -
"6tun,anan-pa,a*! " ?
t7ttpa,a*./e7t ? -
"6tun,anan-lain-lain!" ?
t7ttll./e7t ? -
"6uan-lembur! " ?
t7tulembur./e7t ? -
"6potonan-,amsoste*!" ?
/e7t4o71./e7t ? -
" +.ere *d-*arya+an! >" ?
t7t*ode*arya+an./e7t ? ">"
I$ conn.State ! ConnectionState.Open /.en conn.Close()
conn.Open()
command.E7ecute&on@uery()
conn.Close()
Dim datar+ As Data'o+ !
dset.tb-*arya+an.%ind4y*d-*arya+an(t7t*ode*arya+an./e7t)
datar+(B) ! t7t*ode*arya+an./e7t
datar+(1) ! t7tnam./e7t
datar+(3) ! t7ttempatla.ir./e7t
datar+(;) ! dtptlLa.ir.5alue
datar+(<) ! t7talamat./e7t
datar+(J) ! t7ttelpon./e7t
datar+(E) ! t7t.p./e7t
datar+(K) ! II$(rdopria.C.ec*ed6 "Pria"6 "1anita")
datar+(L) ! aama
datar+(I) ! pt*p
datar+(1B) ! dtptlMasu*.5alue
datar+(11) ! t7t,abatan./e7t
datar+(13) ! t7ta,ipo*o*./e7t
datar+(1;) ! t7tu$unsional./e7t
datar+(1<) ! t7tutransport./e7t
datar+(1J) ! t7tuma*an./e7t
datar+(1E) ! t7tt,amsoste*./e7t
datar+(1K) ! t7ttpa,a*./e7t
datar+(1L) ! t7ttll./e7t
datar+(1I) ! t7tulembur./e7t
datar+(3B) ! /e7t4o71./e7t
End I$
Messae4o7.S.o+("data tela. di Simpan ")
Me.Close()
Catc. e7 As E7ception
Messae4o7.S.o+(e7.Messae)
End /ry


End Sub


Pri2ate Sub t7ttelpon-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles t7ttelpon./e7tC.aned
End Sub
Pri2ate Sub $ormtamba.*arya+an-Load(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub 4utton<-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton<.Clic*
Me.Close()
End Sub
Pri2ate Sub t7ta,ipo*o*-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles t7ta,ipo*o*./e7tC.aned6
t7tu$unsional./e7tC.aned6 t7tuma*an./e7tC.aned6
t7tutransport./e7tC.aned6 t7ttll./e7tC.aned
Dim ,** As Double
Dim ,*m As Double
Dim ,.t As Double
Dim ,.ts As Double
Dim ,.tp As Double
t7tulembur./e7t ! (5al(t7ta,ipo*o*./e7t) F
5al(t7tu$unsional./e7t) F 5al(t7tutransport./e7t) F
5al(t7tuma*an./e7t) F 5al(t7ttpa,a*./e7t) F 5al(t7ttll./e7t)) 8 1K;
,** ! (5al(t7ta,ipo*o*./e7t) F 5al(t7tu$unsional./e7t) F
5al(t7tutransport./e7t) F 5al(t7tuma*an./e7t) F 5al(t7ttll./e7t)) C
B.BBJ<
,*m ! (5al(t7ta,ipo*o*./e7t) F 5al(t7tu$unsional./e7t) F
5al(t7tutransport./e7t) F 5al(t7tuma*an./e7t) F 5al(t7ttll./e7t)) C
B.BB;
,.t ! (5al(t7ta,ipo*o*./e7t) F 5al(t7tu$unsional./e7t) F
5al(t7tutransport./e7t) F 5al(t7tuma*an./e7t) F 5al(t7ttll./e7t)) C
B.BJK
,.ts ! ,.t C B.;
,.tp ! ,.t C B.K
t7tt,amsoste*./e7t ! ,.tp
/e7t4o71./e7t ! ,** F ,*m F ,.ts
End Sub
Pri2ate Sub /e7t4o71-/e7tC.aned(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles /e7t4o71./e7tC.aned
End Sub
Pri2ate Sub $ormtamba.*arya+an-Closin(4y5al sender As Ob,ect6 4y5al
e As System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$*arya+an ! &ot.in
End Sub
End Class
Imports System.Data.SqlClient
Public Class %orm-/0'
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub cmdSearc.-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles cmdSearc..Clic*
Dim $ As &e+ %rm*arya+an
$.4utton1.5isible ! %alse
$.4utton3.5isible ! %alse
$.4utton;.5isible ! %alse
$.4utton<.5isible ! %alse
$.panil ! "/.r"
$.S.o+()
End Sub
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim com As &e+ SqlCommand
/ry
com.Connection ! conn
conn.Open()
com.Command/e7t ! "Insert into tb-/0' 2alues(>" ?
t7t=ode./e7t ? ">6>" ? %ormat(&o+6 "MM8dd8yyyy") ? ">6" ? /e7t4o71./e7t
? ")"
com.E7ecute&on@uery()
conn.Close()
Messae4o7.S.o+("Data tela. disimpan")
/e7t4o71./e7t ! ""
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
Catc. e7 As E7ception
I$ conn.State ! ConnectionState.Open /.en conn.Close()
Messae4o7.S.o+("/ela. menerima /0' ta.un ini ")
/e7t4o71./e7t ! ""
t7t=ode./e7t ! ""
t7t&ama./e7t ! ""
End /ry

End Sub
Pri2ate Sub %orm-/0'-Load(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub %orm-/0'-Closin(4y5al sender As Ob,ect6 4y5al e As
System.ComponentModel.CancelE2entArs) 0andles My4ase.Closin
$t.r ! &ot.in
End Sub
Pri2ate Sub 4utton3-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton3.Clic*
Me.Close()
End Sub
End Class
Imports CrystalDecisions.Crystal'eports.Enine
Public Class $rm%ilter'eport=arya+an
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub 4utton1-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles 4utton1.Clic*
Dim a As &e+ 'eportDocument
a.Load("laporan *arya+an.rpt")
a.SetDatabaseLoon("sa"6 "sa"6 "."6 "I&D'A")
I$ cmb=ota.SelectedItem GH "All" /.en
a.'ecordSelection%ormula ! "Ptb-*arya+an.tempat-la.irQ!>" ?
cmb=ota.SelectedItem ? ">"
End I$
>a.'ecordSelection%ormula ! "Ptb-a,i.bulanQ!" ? t7tbulan.te7t
? " and Ptb-a,i.ta.unQ!" ? t7tta.un.te7t"
Dim $ As &e+ $rmreport
$.Crystal'eport5ie+er1.'eportSource ! a
$.S.o+()
Me.Close()
End Sub
Pri2ate Sub $rm%ilter'eport=arya+an-Load(4y5al sender As
System.Ob,ect6 4y5al e As System.E2entArs) 0andles My4ase.Load
End Sub
Pri2ate Sub cmb=ota-SelectedInde7C.aned(4y5al sender As
System.Ob,ect6 4y5al e As System.E2entArs) 0andles
cmb=ota.SelectedInde7C.aned
End Sub
End Class
Public Class test-sortin-lap-a,i
In.erits System.1indo+s.%orms.%orm
Pri2ate Sub test-sortin-lap-a,i-Load(4y5al sender As System.Ob,ect6
4y5al e As System.E2entArs) 0andles My4ase.Load

End Sub
Pri2ate Sub Label3-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles Label3.Clic*
End Sub
Pri2ate Sub ceta*-Clic*(4y5al sender As System.Ob,ect6 4y5al e As
System.E2entArs) 0andles ceta*.Clic*
Dim pen, As &e+ 'eportDocument
pen,.Load("lap a,i.rpt")
pen,.SetDatabaseLoon("sa"6 "sa"6 "."6 "I&D'A")
pen,.'ecordSelection%ormula ! "Ptr-a,i.bulanQ H! S" ?
Combo4o71.SelectedItem ? "S and Ptr-a,i.ta.unQG! S" ?
Combo4o73.SelectedItem ? "S"
>pen,.'ecordSelection%ormula !
"Ptr-pen,ualan.*d-pen,ualanQ!>91BB1>"
>Crystal'eport5ie+er1.Selection%ormula !
"Ptr-pen,ualan.*d-pen,ualanQ!>91BB1>"
Dim $ As &e+ $rmreport
$.Crystal'eport5ie+er1.'eportSource ! pen,
$.S.o+()
Me.Close()
End Sub
End Class

You might also like