示例#1
0
        private void btnCetakLabelNota_Click(object sender, EventArgs e)
        {
            if (MsgHelper.MsgKonfirmasi("Apakah proses pencetakan ingin dilanjutkan ?"))
            {
                using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0)))
                {
                    IJualProdukBll bll    = new JualProdukBll(_log);
                    var            result = bll.Update(_jual);

                    PreviewLabelNota(_jual, false);
                }
            }
        }
示例#2
0
        public void Ok(object sender, object data)
        {
            if (data is ItemJualProduk) // pencarian produk baku
            {
                var itemJual = (ItemJualProduk)data;
                var produk   = itemJual.Produk;

                if (!IsExist(produk.produk_id))
                {
                    SetItemProduk(this.gridControl, _rowIndex, itemJual, itemJual.jumlah - itemJual.jumlah_retur, itemJual.harga_jual);
                    this.gridControl.Refresh();
                    RefreshTotal();

                    GridListControlHelper.SetCurrentCell(this.gridControl, _rowIndex, _colIndex + 1);

                    RefreshTotal();
                }
                else
                {
                    MsgHelper.MsgWarning("Data produk sudah diinputkan");
                    GridListControlHelper.SelectCellText(this.gridControl, _rowIndex, _colIndex);
                }
            }
            else if (data is Customer) // pencarian customer
            {
                this._customer   = (Customer)data;
                txtCustomer.Text = this._customer.nama_customer;
                KeyPressHelper.NextFocus();
            }
            else if (data is JualProduk) // pencarian data jual
            {
                IJualProdukBll bll = new JualProdukBll(_log);

                this._jual           = (JualProduk)data;
                this._jual.item_jual = bll.GetItemJual(this._jual.jual_id).ToList();
                txtNotaJual.Text     = this._jual.nota;

                KeyPressHelper.NextFocus();
            }
        }
示例#3
0
        private void txtNotaJual_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (KeyPressHelper.IsEnter(e))
            {
                if (this._customer == null || txtCustomer.Text.Length == 0)
                {
                    MsgHelper.MsgWarning("Maaf isian data belum lengkap !");
                    txtCustomer.Focus();

                    return;
                }

                var nota = ((TextBox)sender).Text;

                IJualProdukBll bll        = new JualProdukBll(_log);
                var            listOfJual = bll.GetNotaCustomer(this._customer.customer_id, nota);

                if (listOfJual.Count == 0)
                {
                    MsgHelper.MsgWarning("Data nota jual tidak ditemukan");
                    txtNotaJual.Focus();
                    txtNotaJual.SelectAll();
                }
                else if (listOfJual.Count == 1)
                {
                    _jual           = listOfJual[0];
                    _jual.item_jual = bll.GetItemJual(_jual.jual_id).ToList();

                    txtNotaJual.Text = _jual.nota;
                    KeyPressHelper.NextFocus();
                }
                else // data lebih dari satu
                {
                    var frmLookup = new FrmLookupNota("Data Nota Penjualan", listOfJual);
                    frmLookup.Listener = this;
                    frmLookup.ShowDialog();
                }
            }
        }
示例#4
0
        protected override void Pilih()
        {
            var rowIndex = this.gridList.SelectedIndex;

            if (!base.IsSelectedItem(rowIndex, this.Text))
            {
                return;
            }

            if (_pengaturanUmum.is_auto_print)
            {
                if (MsgHelper.MsgKonfirmasi("Apakah proses pencetakan ingin dilanjutkan ?"))
                {
                    var jual = _listOfJual[rowIndex];
                    if (jual != null)
                    {
                        IJualProdukBll bll = new JualProdukBll(_log);
                        jual.item_jual = bll.GetItemJual(jual.jual_id).ToList();
                    }

                    switch (_pengaturanUmum.jenis_printer)
                    {
                    case JenisPrinter.DotMatrix:
                        CetakNotaDotMatrix(jual);
                        break;

                    case JenisPrinter.MiniPOS:
                        CetakNotaMiniPOS(jual);
                        break;

                    default:
                        // do nothing
                        break;
                    }
                }
            }
        }
示例#5
0
        private void LoadItemJual(JualProduk jualProduk)
        {
            IJualProdukBll bll = new JualProdukBll(_log);

            _jual.item_jual = bll.GetItemJual(_jual.jual_id).ToList();
        }
        private void gridControl_CurrentCellKeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                var grid = (GridControl)sender;

                var rowIndex = grid.CurrentCell.RowIndex;
                var colIndex = grid.CurrentCell.ColIndex;

                switch (colIndex)
                {
                case 2:     // kolom nota
                    if (this._customer == null || txtCustomer.Text.Length == 0)
                    {
                        MsgHelper.MsgWarning("Nama Customer belum diinputkan");
                        txtCustomer.Focus();
                        return;
                    }

                    var cc   = grid.CurrentCell;
                    var nota = cc.Renderer.ControlValue.ToString();

                    IList <JualProduk> listOfJual = null;
                    IJualProdukBll     bll        = new JualProdukBll(MainProgram.isUseWebAPI, MainProgram.baseUrl, _log);

                    if (nota.Length > 0)     // menampilkan nota kredit berdasarkan nota
                    {
                        listOfJual = bll.GetNotaKreditByNota(this._customer.customer_id, nota);
                    }
                    else
                    {
                        listOfJual = bll.GetNotaKreditByCustomer(this._customer.customer_id, false);
                    }

                    if (listOfJual.Count == 0)
                    {
                        MsgHelper.MsgWarning("Data penjualan kredit tidak ditemukan");
                        GridListControlHelper.SelectCellText(grid, rowIndex, colIndex);
                    }
                    else if (listOfJual.Count == 1)
                    {
                        var jual = listOfJual[0];

                        if (!IsExist(jual.nota))
                        {
                            SetItemBayar(grid, rowIndex, colIndex, jual);
                            grid.Refresh();

                            GridListControlHelper.SetCurrentCell(grid, rowIndex, 5);     // kolom pembayaran
                        }
                        else
                        {
                            MsgHelper.MsgWarning("Data pembayaran sudah diinputkan");
                            GridListControlHelper.SelectCellText(grid, rowIndex, colIndex);
                        }
                    }
                    else     // data nota lebih dari satu, tampilkan di form lookup
                    {
                        _rowIndex = rowIndex;
                        _colIndex = colIndex;

                        var frmLookup = new FrmLookupNota("Data Nota Penjualan", listOfJual);
                        frmLookup.Listener = this;
                        frmLookup.ShowDialog();
                    }

                    break;

                case 6:     // keterangan
                    if (grid.RowCount == rowIndex)
                    {
                        _listOfItemPembayaranPiutang.Add(new ItemPembayaranPiutangProduk());
                        grid.RowCount = _listOfItemPembayaranPiutang.Count;
                    }

                    GridListControlHelper.SetCurrentCell(grid, rowIndex + 1, 2);     // fokus ke kolom nota jual
                    break;

                default:
                    break;
                }
            }
        }