0

Laporan dan Aplikasi rental menggunakan C sharp/ C# (4)

Posted by Jujur Sitanggang on 3:25 PM

Psoude-Code


Class sopir

===============
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace index
{
   class sopir
   {
       private string id;
       private string nama;
       private string notelp;
       private string alamat;
       private string status;


       public string Id
       {
           get { return id; }
           set { id = value; }
       }
       public string Nama
       {
           get { return nama; }
           set { nama= value; }
       }
       public string Notelp
       {
           get { return notelp; }
           set { notelp = value; }
       }
       public string Alamat
       {
           get { return alamat; }
           set { alamat = value; }
       }
       public string Status
       {
           get { return status; }
           set { status = value; }
       }


   }
}

Class pelanggan

===================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace index
{
   class CPelanggan
   {
           private string _id;
           private string _nama;
           private string _jk;
           private string _alamat;
           private string _phone;
           private string _jenisID;


           public string id
           {
               get { return _id; }
               set { _id = value; }
           }


           public string nama
           {
               get { return _nama; }
               set { _nama = value; }
           }


           public string Jk
           {
               get { return _jk; }
               set { _jk = value; }
           }


           public string alamat
           {
               get { return _alamat; }
               set { _alamat = value; }
           }


           public string phone
           {
               get { return _phone; }
               set { _phone = value; }
           }


           public string jenisID
           {
               get { return _jenisID; }
               set { _jenisID = value; }
           }
   }
}

Class mobil

===============
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace index
{
   class mobil
   {
       private string id;
       private string merk;
       private string warna;
       private string tahun;
       private string kode_mobil;
       private string status;


       public string Id
       {
           get { return id; }
           set { id = value; }
       }


       public string Merk
       {
           get { return merk; }
           set { merk = value; }
       }


       public string Warna
       {
           get { return warna; }
           set { warna = value; }
       }


       public string Tahun
       {
           get { return tahun; }
           set { tahun = value; }
       }


       public string Kode_mobil
       {
           get { return kode_mobil; }
           set { kode_mobil = value; }
       }


       public string Status
       {
           get { return status; }
           set { status = value; }
       }
   }
}

Class harga_sewa

====================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Data;


namespace index
{
   class hargasewa
   {
       private kon koneksi = new kon();
       private string sql = null;
       private DataTable tharga = new DataTable();

       // membaca semua field di database
       public DataTable bacasemua()
       {
           sql = "SELECT id as 'ID',golongan as 'GOLONGAN', harga as 'HARGA' FROM harga_sewa";
           tharga = koneksi.tampil_data(sql);
           return tharga;
       }


       public bool insert(fields fl)
       {
           sql = "INSERT INTO harga_sewa VALUES ('" + fl.Id + "','" + fl.Golongan + "','" + fl.Harga + "')";
           Boolean stat = true;
           koneksi.dml(sql);
           return stat;
       }
   }
}

class field

===============
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace index
{
   class fields
   {
       private int id;
       private string golongan;
       private int harga;


       public int Id
       {
           get { return id; }
           set { id = value; }
       }
       public string Golongan
       {
           get { return golongan; }
           set { golongan = value; }
       }
       public int Harga
       {
           get { return harga; }
           set { harga = value; }
       }
   }
}

NEXT

0 Comments

Copyright Jujur Soaloon Sitangang Lipan All rights reserved. Theme by Sitanggang. | Bloggerized by Soalparna.