Exemple #1
0
        private void reprintBtn_Click(object sender, EventArgs e)
        {
            DialogResult diagRes = MessageBox.Show("Do you want to reprint receipt?", "Confirmation", MessageBoxButtons.YesNo);

            if (diagRes == DialogResult.No)
            {
                return;
            }
            try {
                //MessageBox.Show(this.get_selected_row() + "");
                var _selected_id = this.get_selected_row();
                if (_selected_id == -1)
                {
                    return;
                }
                MDB_Sale saleObjModel = this.getThisSale(_selected_id);

                List <MDB_SingleItemSale> itemsListForReceipt = Newtonsoft.Json.JsonConvert.DeserializeObject <List <MDB_SingleItemSale> >(saleObjModel.json_sales);

                GINCOTEXFiscalPrinter printer = new GINCOTEXFiscalPrinter(itemsListForReceipt, saleObjModel);
                printer.PRINT_NOW();

                //update printed counts
                saleController.addPrintCountToSale(_selected_id);

                //refresh the list
                var li = saleController.get_my_sales_list();
                currentTransctionsList       = new SortableBindingList <MDB_Sale>(li);
                salesDataGridView.DataSource = this.currentTransctionsList;
            }catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }