Beispiel #1
0
        /// <summary>
        /// Berfungsi sebagai penampil details transaksi.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="kode"></param>
        /// <param name="jenis"></param>
        /// <param name="harga"></param>
        private void AddDetails(string name, string kode, string jenis, int harga, int jumlah)
        {
            utils = new Ultilities();

            utils.ClearLabel(lblDetailBarang, name);
            utils.ClearLabel(lblDetailKode, kode);
            utils.ClearLabel(lblDetailJenis, jenis);
            utils.ClearLabel(lblDetailJumlah, jumlah.ToString());
            if (int.Parse(comboDiskon.Text.Replace("%", "")) > 0)
            {
                utils.ClearLabel(lblDetailHarga, "Rp" + harga.ToString("N0") + " (" + comboDiskon.Text + ")");
            }
            else
            {
                utils.ClearLabel(lblDetailHarga, "Rp" + harga.ToString("N0"));
            }
        }
Beispiel #2
0
        /// <summary>
        /// Menghapus details transaksi
        /// </summary>
        private void RemoveDetails()
        {
            utils = new Ultilities();

            for (int i = 0; i < _kode.Count; i++)
            {
                if (_kode[i] != null)
                {
                    utils.ClearLabel(lblDetailBarang, _name[i]);
                    utils.ClearLabel(lblDetailKode, _kode[i]);
                    utils.ClearLabel(lblDetailJenis, _jenis[i]);
                    utils.ClearLabel(lblDetailJumlah, _jumlah[i].ToString());
                    if (_diskon[i] > 0)
                    {
                        utils.ClearLabel(lblDetailHarga, "Rp" + _harga[i].ToString("N0") + " (" + _diskon[i] + "%)");
                    }
                    else
                    {
                        utils.ClearLabel(lblDetailHarga, "Rp" + _harga[i].ToString("N0"));
                    }
                }
            }

            if (_kode.Count == 0)
            {
                utils.ClearLabel(lblDetailBarang, "?");
                utils.ClearLabel(lblDetailKode, "?");
                utils.ClearLabel(lblDetailJenis, "?");
                utils.ClearLabel(lblDetailJumlah, "?");
                utils.ClearLabel(lblDetailHarga, "?");
            }
        }