Selasa, 08 Januari 2019

WebApplicationSepatu







Imports System.Data
Imports System.Data.OleDb
Public Class WebFormHotel
    Inherits System.Web.UI.Page
    Dim koneksi As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\LENOVO\Documents\DBHotel.accdb"
    Dim objekKoneksi As New OleDb.OleDbConnection(koneksi)
    Dim Xreader As OleDb.OleDbDataReader
    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
        objekKoneksi.Open()
        Dim tambah As String = "INSERT INTO Hotel values('" & TextNo.Text & "','" & TextJenis.Text & "','" & TextFasilitas.Text & "','" & TextLantai.Text & "','" & TextTarif.Text & "')"
        Dim oCmd = New OleDbCommand(tambah, objekKoneksi)
        oCmd.ExecuteNonQuery()
        objekKoneksi.Close()
        MsgBox("Selamat Anda Sukses Gan")
    End Sub

    Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If Not Len(TextNo.Text) = 0 Then
            objekKoneksi.Close()
            objekKoneksi.Open()
            Dim ocmd As New OleDb.OleDbCommand("SELECT * FROM Hotel where NOKAMAR='" + TextNo.Text + "'", objekKoneksi)

            Xreader = ocmd.ExecuteReader()
            If Xreader.HasRows Then
                Xreader.Read()
                TextNo.Text = Xreader("NOKAMAR")
                TextJenis.Text = Xreader("JENISKAMAR")
                TextFasilitas.Text = Xreader("FASILITAS")
                TextLantai.Text = Xreader("LANTAIKE")
                TextTarif.Text = Xreader("TARIF")
                Button4.Enabled = True
            Else
                TextNo.Text = "Nama Hotel Tidak ada"
                Exit Sub
            End If
            Xreader.Close()
        End If
    End Sub

    Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Response.Redirect("WebFormWeb.aspx")
    End Sub

    Protected Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        objekKoneksi.Open()
        Dim Rubah As String = "Update Hotel set TARIF='" + TextTarif.Text + "' where NOKAMAR='" + (TextNo.Text) + "'"
        Dim oCmd = New OleDbCommand(Rubah, objekKoneksi)
        oCmd.ExecuteNonQuery()
        objekKoneksi.Close()
        MsgBox("Sukses Gan")
    End Sub

    Protected Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        TextNo.Text = ""
        TextJenis.Text = ""
        TextFasilitas.Text = ""
        TextLantai.Text = ""
        TextTarif.Text = ""
    End Sub
End Class

Selasa, 30 Oktober 2018

Saya membuat project ini untuk mengakses lebih mudah bisnis online, dengan cara ini akan lebih fleksibel dalam pemesanan lewat aplikasi Visual Studio. berikut design yang saya buat di Aplikas Visual Studio

Design yang saya buat, diaplikasi Visual Studio Penjualan secara Online.


setelah sudah distart melalui codingan dalam aplikasi tersebut, dan diedit sedemikian rupa, supaya orang melihat tersebut.


ini setelah melalui codingan yang akan saya cantumkan nanti dibawah ini, codingan import dari apk Visual ke word

dan ini hasil dari excel setelah di import dari Visual Studio dan dicoding.


Berikut ini codingan dari project saya: 

Imports word = Microsoft.Office.Interop.Word
Imports excel = Microsoft.Office.Interop.Excel

Public Class Form1

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        Pb1.Image = System.Drawing.Image.FromFile("D:\sasa\adidas.JPEG")
        TxtHarga.Text = "700000"
    End Sub


    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
        Pb1.Image = System.Drawing.Image.FromFile("D:\sasa\nike.jpeg")
        TxtHarga.Text = "650000"
    End Sub

    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
        Pb1.Image = System.Drawing.Image.FromFile("D:\sasa\puma.jpeg")
        TxtHarga.Text = "500000"
    End Sub

    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
        Pb1.Image = System.Drawing.Image.FromFile("D:\sasa\reebook.jpeg")
        TxtHarga.Text = "750000"
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox3.Text = Val(TextBox2.Text) - Val(TxtHarga.Text)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim aplikasi As New word.Application
        Dim dokumen As word.Document

        dokumen = aplikasi.Documents.Open("D:\ABDUL SEPATU ONLINE.docx")
        dokumen = aplikasi.Documents.Open("D:\ABDUL SEPATU ONLINE.docx")
        dokumen = aplikasi.Documents.Open("D:\ABDUL SEPATU ONLINE.docx")
        dokumen = aplikasi.Documents.Open("D:\ABDUL SEPATU ONLINE.docx")
        dokumen = aplikasi.Documents.Open("D:\ABDUL SEPATU ONLINE.docx")

        dokumen.Bookmarks("Bharga").Select()
        aplikasi.Selection.TypeText(TxtHarga.Text)

        dokumen.Bookmarks("Bkembalian").Select()
        aplikasi.Selection.TypeText(TextBox3.Text)

        dokumen.Bookmarks("Bbayar").Select()
        aplikasi.Selection.TypeText(TextBox2.Text)

        dokumen.Bookmarks("Bjenissepatu").Select()
        aplikasi.Selection.TypeText(CheckBox1.Text)


        dokumen.SaveAs("D:\sasa\TxtHarga.Text+TextBox3.Text+TextBox2.Text+CheckBox1.Text.docx")
        aplikasi.Visible = True
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim AplikasiExcel As New excel.Application
        Dim FileExcel As excel.Workbook

        FileExcel = AplikasiExcel.Workbooks.Open("D:\sasa\Book1.xlsx")
        AplikasiExcel.Range("A2").Value = TxtHarga.Text
        AplikasiExcel.Range("B2").Value = TextBox3.Text
        AplikasiExcel.Range("C2").Value = TextBox2.Text
        AplikasiExcel.Range("D2").Value = CheckBox1.Text
        FileExcel.SaveAs("D:\sasa\Book1New.xlsx")
        AplikasiExcel.Visible = True
    End Sub
End Class