Monday, 18 November 2019

UAS Pemrograman Web 2 STMIK Eresha

Description

Project Title : DATABASE ABSENSI KARYAWAN
Dibuad Oentoek Melihat History Absensi
Connected to MS Access
Tampilan login dengan username dan password
On Login Interface if username/password is wrong, then show msgbox wrong username or password
On login interface if username/password is empty, then show msgbox please fill the username or password
pada master view, terdapat id karyawan, nama karyawan, jabatan karyawan, jumlah hari hadir, jumlah hari tidak hadir, jumlah hari kerja 1 bulan (senin-jumat)

And Here We Go !!!!!!!!!






SC

Login :
Public Class _Default
    Inherits Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Protected Sub bLOGIN_Click(sender As Object, e As EventArgs) Handles bLOGIN.Click
        If tbUSER.Text = "admin" And tbPASS.Text = "password" Then
        Else
            MsgBox("SalahKamar")
            tbUSER.Text = ""
            tbPASS.Text = ""
        End If
    End Sub

    Protected Sub bEXIT_Click(sender As Object, e As EventArgs) Handles bEXIT.Click

    End Sub
End Class

Interface :
Imports System.Data
Imports System.Data.OleDb

Public Class About
    Inherits Page
    Dim golongan As String
    Dim Koneksi As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\KaeL\Desktop\Web2UAS\UAS.accdb"
    Dim objekKoneksi As New OleDb.OleDbConnection(Koneksi)
    Dim Xreader As OleDb.OleDbDataReader

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Protected Sub bSAACC_Click(sender As Object, e As EventArgs) Handles bSAACC.Click
        objekKoneksi.Open()
        Dim tambah As String = "INSERT INTO UAS values('" & tbID.Text & "','" & tbNAMA.Text & "','" & tbJabKar.Text & "' , '" & tbJHHadir.Text & "', '" & tbJHTH.Text & "', '" & tbJHK1B.Text & "')"
        Dim oCmd = New OleDbCommand(tambah, objekKoneksi)
        oCmd.ExecuteNonQuery()
        MsgBox("Sukses")
    End Sub

    Protected Sub bCARI_Click(sender As Object, e As EventArgs) Handles bCARI.Click
        If Not Len(tbID.Text) = 0 Then
            objekKoneksi.Close()
            objekKoneksi.Open()
            Dim oCmd As New OleDb.OleDbCommand("SELECT * FROM UAS WHERE ID Karyawan = '" + tbID.Text + "'", objekKoneksi)

            Xreader = oCmd.ExecuteReader()
            If Xreader.HasRows Then
                tbID.Text = "ID Sudah Ada"
            Else
                tbNAMA.Focus()
            End If

        End If
    End Sub
End Class

Absensi DB :
<%@ Page Title="Contact" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Absent DB.aspx.vb" Inherits="Access.Contact" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <hgroup class="title">
        <h1><%: Title %></h1>
    </hgroup>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="ID Karyawan" DataSourceID="SqlDataSource1">
    <Columns>
        <asp:BoundField DataField="ID Karyawan" HeaderText="ID Karyawan" ReadOnly="True" SortExpression="ID Karyawan" />
        <asp:BoundField DataField="Nama Karyawan" HeaderText="Nama Karyawan" SortExpression="Nama Karyawan" />
        <asp:BoundField DataField="Jabatan Karyawan" HeaderText="Jabatan Karyawan" SortExpression="Jabatan Karyawan" />
        <asp:BoundField DataField="Jumlah Hari Hadir" HeaderText="Jumlah Hari Hadir" SortExpression="Jumlah Hari Hadir" />
        <asp:BoundField DataField="Jumlah Hari Tidak Hadir" HeaderText="Jumlah Hari Tidak Hadir" SortExpression="Jumlah Hari Tidak Hadir" />
        <asp:BoundField DataField="Jumlah Hari Kerja 1 Bulan" HeaderText="Jumlah Hari Kerja 1 Bulan" SortExpression="Jumlah Hari Kerja 1 Bulan" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT * FROM [Table1]"></asp:SqlDataSource>
</asp:Content>

Sekian Terimakasih

Sunday, 3 November 2019

UTS Pemrograman Web 2 STMIK ERESHA

Dear Brothers and Sisters,

Hari ini, saya akan menunjukkan tutorial Visual Studio 2012, Dimana pada post kali ini, akan ada cara untuk membuat koneksi antara Visual Studio 2012 dengan Microsoft Office Word dan Microsoft Office Excel,

Well,, without further ado, LET THE GAME BEGIN !!!


Explanation...
This Application is Made to be an alternative version for Fingerprint Absent Machine
Connected to MS Word (As a Reference to Each Personnel)
Connected to MS Excel (As a Reference to All Personnel)
In MS Word, the interface shown is Vertical
In MS Excel, the interface shown is Horizontal
File Name can be changed as needed for MS Word / MS Excel
At the Form, there are "ID Karyawan","Nama Karyawan","Jabatan Karyawan","Jumlah Hari Hadir","Jumlah Hari Tidak Hadir","Jumlah Hari Kerja dalam 1 Bulan"
Made to make it easier when there are difference in Fingerprint result and Application result
Can be used as a reference to calculate Gross Salary

Here's the Source Code =D

SOURCE CODE START HERE !!!

IMPORTS

Imports excel = Microsoft.Office.Interop.Excel
Imports Word = Microsoft.Office.Interop.Word
Imports System.Data

Imports System.Data.OleDb

WORD

Dim Aplikasi As New Word.Application
        Dim Dokumen As Word.Document
        Dim FilePath As String

        Dokumen = Aplikasi.Documents.Open("C:\Users\user\Desktop\Kul\Web2\UTS.docx")

        Dokumen.Bookmarks("ID").Select()
        Aplikasi.Selection.TypeText(tbID.Text)

        Dokumen.Bookmarks("Nama").Select()
        Aplikasi.Selection.TypeText(tbNAMA.Text)

        Dokumen.Bookmarks("JabKar").Select()
        Aplikasi.Selection.TypeText(tbJABKAR.Text)

        Dokumen.Bookmarks("JHHadir").Select()
        Aplikasi.Selection.TypeText(tbJHHADIR.Text)

        Dokumen.Bookmarks("JHTHadir").Select()
        Aplikasi.Selection.TypeText(tbJTHADIR.Text)

        Dokumen.Bookmarks("JHK1B").Select()
        Aplikasi.Selection.TypeText(tbJHK1B.Text)
`Untuk mengganti nama File, cukup mengganti angka dibelakang UTS
        FilePath = "C:\Users\user\Desktop\Kul\Web2\UTS1.docx"

        Dokumen.SaveAs2(FilePath)
        MsgBox("Success")

        Aplikasi.Visible = True

EXCEL

Dim AplikasiExcel As New excel.Application
        Dim DocumentExcel As excel.Workbook
        Dim FilePath As String
        DocumentExcel = AplikasiExcel.Workbooks.Open("C:\Users\user\Desktop\Kul\Web2\UTS.xlsx")
        AplikasiExcel.Range("A2").Value = tbID.Text
        AplikasiExcel.Range("B2").Value = tbNAMA.Text
        AplikasiExcel.Range("C2").Value = tbJABKAR.Text
        AplikasiExcel.Range("D2").Value = tbJHHADIR.Text
        AplikasiExcel.Range("E2").Value = tbJTHADIR.Text
        AplikasiExcel.Range("F2").Value = tbJHK1B.Text
`Untuk mengganti nama File, cukup mengganti angka dibelakang UTS
        FilePath = "C:\Users\user\Desktop\Kul\Web2\UTS1.xlsx"
        DocumentExcel.SaveAs(FilePath)
        MsgBox("Success")
        AplikasiExcel.Visible = True

SOURCE CODE END HERE !!!

And Here's the SS from Browser

And Another SS From Word

At Last but not Least, SS from Excel


Well,, that's that brothers and sisters,

Please stay tune, next time we met, i'm gonna post an endangering tutorial,,

Thank you for your visit,,, G'Bye =D=D