Senin, 18 November 2019

Membuat Aplikasi sederhana berbasis Web/ASP Tugas UAS Pemrograman 2

Assalamualaikum :


Nama : Aris Setiawan

Nim : 161021450487

Kelas : 06-TPLE-004

Tugas : UAS Bpk Agus


program web yang saya buat meneruskan program yang sudah saya buat ketika ujian tengah semester , kali ini berbeda dengan program sebelumnya karna program yang saya buat tersimpan di database (microsoft access) bukan lagi di microsoft word atau microsoft ecxcel yang dimana program ini dapat memudahkan untuk ujser mencari data data yang sudah tersimpan di database sehingga meminmalisir waktu ketika kita mencari data yang sudah kita buat..















----------------------------------------------------------

WebFrom1.aspx.vb

----------------------------------------------------------

Imports System.Data

Imports System.Data.OleDb

Public Class WebForm1


    Inherits System.Web.UI.Page

    Dim golongan As String

    Dim Koneksi As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Pribadi\backup aris\Pemrograman Web\DatabaseAris.accdb"

    Dim objekKoneksi As New OleDb.OleDbConnection(Koneksi)


    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        objekKoneksi.Open()

        Dim tambah As String = "INSERT INTO uasaris values('" & TxtNIM.Text & "','" & TxtNAMA.Text & "','" & TxtLAHIR.Text & "','" & TxtALAMAT.Text & "','" & TxtAGAMA.Text & "','" & TxtTELPON.Text & "')"

        Dim oCmd = New OleDbCommand(tambah, objekKoneksi)

        oCmd.ExecuteNonQuery()

        MsgBox("sukses")


    End Sub


    Protected Sub TxtNAMA_TextChanged(sender As Object, e As EventArgs) Handles TxtNAMA.TextChanged


    End Sub


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


    End Sub


End Class


----------------------------------------------------------

Site.Master

----------------------------------------------------------

<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">

    <table class="auto-style1">

    <tr>

        <td class="auto-style2">

            <asp:Label ID="Label1" runat="server" Text="NIM"></asp:Label>

        </td>

        <td class="auto-style2">

            <asp:TextBox ID="TxtNIM" runat="server"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td>

            <asp:Label ID="Label2" runat="server" Text="NAMA PEGAWAI"></asp:Label>

        </td>

        <td>

            <asp:TextBox ID="TxtNAMA" runat="server"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td>

            <asp:Label ID="Label3" runat="server" Text="TEMPAT LAHIR"></asp:Label>

        </td>

        <td>

            <asp:TextBox ID="TxtLAHIR" runat="server"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td class="auto-style3">

            <asp:Label ID="Label4" runat="server" Text="ALAMAT"></asp:Label>

        </td>

        <td class="auto-style3">

            <asp:TextBox ID="TxtALAMAT" runat="server"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td class="auto-style3">

            <asp:Label ID="Label5" runat="server" Text="AGAMA"></asp:Label>

        </td>

        <td class="auto-style3">

            <asp:TextBox ID="TxtAGAMA" runat="server"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td class="auto-style3">

            <asp:Label ID="Label6" runat="server" Text="NO TELPON"></asp:Label>

        </td>

        <td class="auto-style3">

            <asp:TextBox ID="TxtTELPON" runat="server"></asp:TextBox>

        </td>

    </tr>

    <tr>

        <td class="auto-style3">&nbsp;</td>

        <td class="auto-style3">

            <asp:Button ID="Button1" runat="server" Text="SIMPAN" />

            <asp:Button ID="Button3" runat="server" Text="TAMBAH" />

            <asp:Button ID="Button4" runat="server" Text="EDIT" />

        </td>

    </tr>


</table>


----------------------------------------------------------

WebFrom1.aspx

----------------------------------------------------------

<%@ Master Language="VB" AutoEventWireup="true" CodeBehind="Site.master.vb" Inherits="WebApplication2.SiteMaster" %>


<!DOCTYPE html>

<html lang="en">

<head runat="server">

    <meta charset="utf-8" />

    <title><%: Page.Title %> - My ASP.NET Application</title>

    <asp:PlaceHolder runat="server">       

        <%: Scripts.Render("~/bundles/modernizr") %>

    </asp:PlaceHolder>

    <webopt:BundleReference runat="server" Path="~/Content/css" />

    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />

    <meta name="viewport" content="width=device-width" />

    <asp:ContentPlaceHolder runat="server" ID="HeadContent" />

</head>

<body>

    <form runat="server">

    <asp:ScriptManager runat="server">

        <Scripts>

            <%--Framework scripts--%>

            <asp:ScriptReference Name="MsAjaxBundle" />

            <asp:ScriptReference Name="jquery" />

            <asp:ScriptReference Name="jquery.ui.combined" />

            <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />

            <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />

            <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />

            <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />

            <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />

            <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />

            <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />

            <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />

            <asp:ScriptReference Name="WebFormsBundle" />

            <%--Site scripts--%>


        </Scripts>

    </asp:ScriptManager>

    <header>

        <div class="content-wrapper">

            <div class="float-left">

                <p class="site-title">

                    <a runat="server" href="~/">your logo here</a></p>

            </div>

            <div class="float-right">

                <section id="login">

                    <asp:LoginView runat="server" ViewStateMode="Disabled">

                        <AnonymousTemplate>

                            <ul>

                                <li><a id="registerLink" runat="server" href="~/Account/Register.aspx">Register</a></li>

                                <li><a id="loginLink" runat="server" href="~/Account/Login.aspx">Log in</a></li>

                            </ul>

                        </AnonymousTemplate>

                        <LoggedInTemplate>

                            <p>

                                Hello, <a runat="server" class="username" href="~/Account/Manage.aspx" title="Manage your account">

                                    <asp:LoginName runat="server" CssClass="username" />

                                </a>!

                                <asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/" />

                            </p>

                        </LoggedInTemplate>

                    </asp:LoginView>

                </section>

                <nav>

                    <ul id="menu">

                        <li><a runat="server" href="~/">Home</a></li>

                        <li><a runat="server" href="~/About.aspx">Tentang</a></li>

                        <li><a runat="server" href="~/Contact.aspx">Contact</a></li>

                        <li><a id="A2" runat="server" href="~/WebForm2.aspx">Form Input</a></li>

                    </ul>

                </nav>

            </div>

        </div>

    </header>

    <div id="body">

        <asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />

        <section class="content-wrapper main-content clear-fix">

            <asp:ContentPlaceHolder runat="server" ID="MainContent" />

        </section>

    </div>

    <footer>

        <div class="content-wrapper">

            <div class="float-left">

                <p>

                    &copy; <%: DateTime.Now.Year %> - My ASP.NET Application

                </p>

            </div>

        </div>

    </footer>

    </form>

</body>


</html>



berikut tugas uas yang saya buat mohon maaf dan koreksinya Bpk Agus Suharto, jika dalam penulisan atau laporan kurang berkenan, jika teman teman ingin mengorksi mohon di bantu,
terima kasih

Wassalamualaikum wr,wb

Senin, 04 November 2019

Membuat Aplikasi Sederhana ASP/Web Tugas UTS Pemrograman WEB 2

Assalamualaikum :

Nama : Aris Setiawan
Nim : 161021450487
Kelas : 06-TPLE-004
Tugas : UTS Bpk Agus


1. Penjelasan Program Aplikasi

saya membuat desain web data input pegawai yang dimana data tersebut link/konek ke program aplikasi microsoft word dan microsoft excel, program ini  mempermudah user/pemakai untuk menginput data data karyawan in maupun out serta yg belum terdaftar sehingga bisa membantu meringankan tugas jika sedang mencari karyawan yg di cari, jika user memnginput/save as ke word maka data yg di tampilkan hanya berupa tulisan di dalem lembar word sehingga jika kita mncari karyawan harus satu persatu tp jika user memnginput/save as ke excel maka data yg di tampilkan akan mudah mencari nya jika kita mencari karyawan dengan cara memfilternya atau dengan program find..

2. Screenshoot Lembar Jawaban



2. XML Desain
berikut desain nya


3. Source Coding

berikut source coding aplikasi web membuat data input pegawai

Imports System.Net.Mime.MediaTypeNames
Imports word = Microsoft.Office.Interop.Word
Imports excel = Microsoft.Office.Interop.Excel

Public Class WebFormInputPegawai
    Inherits System.Web.UI.Page

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

    End Sub

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim aplikasi As New word.Application
        Dim dokumen As word.Document

        dokumen = aplikasi.Documents.Open("D:\Pribadi\backup aris\Pemrograman Web\uts\input pegawai.docx")

        dokumen.Bookmarks("nik").Select()
        aplikasi.Selection.TypeText(txtnik.Text)

        dokumen.Bookmarks("nama").Select()
        aplikasi.Selection.TypeText(txtnama.Text)

        dokumen.Bookmarks("ttl").Select()
        aplikasi.Selection.TypeText(txtttl.Text)

        dokumen.Bookmarks("alamat").Select()
        aplikasi.Selection.TypeText(txtalamat.Text)

        dokumen.Bookmarks("agama").Select()
        aplikasi.Selection.TypeText(txtagama.Text)

        dokumen.Bookmarks("jk").Select()
        aplikasi.Selection.TypeText(txtjk.Text)

        dokumen.Bookmarks("pt").Select()
        aplikasi.Selection.TypeText(txtpendidikan.Text)

        dokumen.Bookmarks("email").Select()
        aplikasi.Selection.TypeText(txtemail.Text)

        dokumen.Bookmarks("telp").Select()
        aplikasi.Selection.TypeText(txttelp.Text)

        dokumen.Bookmarks("jabatan").Select()
        aplikasi.Selection.TypeText(txtjabatan.Text)

        dokumen.SaveAs2("D:\Pribadi\backup aris\Pemrograman Web\uts\input pegawai.docx")
        MsgBox("sukses")
        aplikasi.Visible = False
    End Sub

    Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim aplikasiExcel As New excel.Application
        Dim fileExcelnya As excel.Workbook

        fileExcelnya = aplikasiExcel.Workbooks.Open("D:\Pribadi\backup aris\Pemrograman Web\uts\input pegawai.xlsx")
        aplikasiExcel.Range("A2").Value = txtnik.Text
        aplikasiExcel.Range("B2").Value = txtnama.Text
        aplikasiExcel.Range("C2").Value = txtttl.Text
        aplikasiExcel.Range("D2").Value = txtalamat.Text
        aplikasiExcel.Range("E2").Value = txtagama.Text
        aplikasiExcel.Range("F2").Value = txtjk.Text
        aplikasiExcel.Range("G2").Value = txtpendidikan.Text
        aplikasiExcel.Range("H2").Value = txtemail.Text
        aplikasiExcel.Range("I2").Value = txttelp.Text
        aplikasiExcel.Range("J2").Value = txtjabatan.Text

        fileExcelnya.SaveAs("D:\Pribadi\backup aris\Pemrograman Web\uts\input pegawai.xlsx")
        MsgBox("Sukses")
        aplikasiExcel.Visible = True

    End Sub
End Class

5. Screen Run Browser

Berikut tampilan Screen Shoot Program Aplikasi yg Sudah saya buat



berikut tugas yang saya buat mohon maaf Bpk Agus Suharto, jika dalam penulisan atau laporan kurang berkenan, jika teman teman ingin mengorksi mohon di bantu,
terima kasih

Wassalamualaikum wr,wb