Kamis, 26 April 2018

CARA MEMBUAT BILLING DENGAN VISUAL STUDIO 2010


Billing



Program Billing

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace Billing
{
    public partial class Form1 : Form
    {
        private Stopwatch wkt = null;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text !="")
            {
                wkt =new Stopwatch();
                 if (button1.Text == "Log In")                
                 {                    
                     label2.Visible = true;                    
                     wkt.Start();                    
                     button1.Text = "Stop";                
                 }                
                 else if (button1.Text == "Stop")                
                 {                    
                     wkt.Stop();                    
                     if (wkt.Elapsed.TotalMinutes <= 30.00)                    
                     {                        
                         MessageBox.Show("Jumlah tagihan anda sebesar Rp.1000", "Total Tagihan");

                    }                    
                     else if (wkt.Elapsed.TotalHours <= 1.00)                    
                     {                        
                         MessageBox.Show("Jumlah Tagihan anda sebesar Rp.2000", "Total Tagihan");
                     }
                      wkt.Reset();                    
                     label2.Visible = false;                    
                     button1.Text = "Log In";                    
                     textBox1.Text = null;                
                 }
                 }            
            else if (textBox1.Text =="")            
            {                
                MessageBox.Show("Nama Harus diisi! ", "Important Message");            
            }                 
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (wkt != null)
            {
                label2.Text = wkt.Elapsed.ToString(@"hh\:mm\:ss");
        }

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}



Running



Hasil Akhir



Nama : Nurul Azizah Kamala
NIM   : 13150733
Kelas  : 13.6A.37
Tugas Network Programing

Tidak ada komentar:

Posting Komentar