Using Using Using Using Using Using Using Using Using: //nama: Muhammad Harry Antomy //NIM: F1E119044
Using Using Using Using Using Using Using Using Using: //nama: Muhammad Harry Antomy //NIM: F1E119044
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Aplikasi_Kasir_Sederhana
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
List<string> nlist = new List<string>();
nlist.Add("Le Mineral");
nlist.Add("Teh Botol");
nlist.Add("Coca Cola");
nlist.Add("Sprite");
nlist.Add("Roti Gandum");
nlist.Add("SariRoti");
nlist.Add("Sabun");
nlist.Add("Shampo");
cmb_nama.DataSource = nlist;
delete();
}
private void delete()
{
cmb_nama.SelectedIndex = -1;
txt_harga.Clear();
num_jml.Value = 0;
cmb_promo.SelectedIndex = -1;
}
if (string.IsNullOrEmpty(txt_harga.Text))
{
MessageBox.Show("Silakan Pilih Item Terlebih
Dahulu","Peringatan",MessageBoxButtons.OK,MessageBoxIcon.Warning);
} else
{
ListViewItem item = new ListViewItem(cmb_nama.Text);
delete();
}
}
private void Btn_Hapus_log_Click(object sender, EventArgs e)
{
if (log_history_view.Items.Count >= 1)
{
if ( MessageBox.Show("Apakah Anda Ingin Menghapus ?", "Peringatan",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
{
log_history_view.Items.Clear();
} else
{
} else
{
MessageBox.Show("Silakan Pilih Item Terlebih Dahulu", "Peringatan",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
Close();
} else
{
cmb_promo.DataSource = nlist;
}
else if (cmb_nama.Text == "Teh Botol")
{
txt_harga.Text = "2000";
num_jml.Value = 1;
cmb_promo.DataSource = nlist;
}
else if (cmb_nama.Text == "Coca Cola")
{
txt_harga.Text = "9000";
num_jml.Value = 1;
cmb_promo.DataSource = nlist;
}
else if (cmb_nama.Text == "Sprite")
{
txt_harga.Text = "10000";
num_jml.Value = 1;
cmb_promo.DataSource = nlist;
}
else if (cmb_nama.Text == "Roti Gandum")
{
txt_harga.Text = "2000";
num_jml.Value = 1;
cmb_promo.DataSource = nlist;
}
}
}
}