Example #1
0
        private void OnDisplayInvoiceInfo()
        {
            if (dgInvoice.SelectedRows == null || dgInvoice.SelectedRows.Count <= 0)
            {
                MsgBox.Show(Application.ProductName, "Vui lòng chọn 1 hóa đơn.", IconType.Information);
                return;
            }

            DataRow         drInvoice = (dgInvoice.SelectedRows[0].DataBoundItem as DataRowView).Row;
            dlgInvoiceInfo2 dlg       = new dlgInvoiceInfo2(drInvoice, true);

            dlg.ShowDialog();
        }
Example #2
0
        private void OnExportInvoice()
        {
            List <DataRow> receiptList = new List <DataRow>();

            receiptList.Add(_drReceipt);
            dlgInvoiceInfo2 dlg = new dlgInvoiceInfo2(receiptList);

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                _isExportedInvoice       = true;
                btnExportInvoice.Enabled = false;
            }
        }
Example #3
0
        private void OnExportInvoice()
        {
            List <DataRow> exportedInvoiceList   = new List <DataRow>();
            List <DataRow> noExportedInvoiceList = new List <DataRow>();
            List <DataRow> checkedRows           = CheckedReceiptRows;

            foreach (DataRow row in checkedRows)
            {
                bool isExported = Convert.ToBoolean(row["IsExportedInvoice"]);
                if (!isExported)
                {
                    noExportedInvoiceList.Add(row);
                }
                else
                {
                    exportedInvoiceList.Add(row);
                }
            }

            if (exportedInvoiceList.Count > 0)
            {
                MsgBox.Show(Application.ProductName, "(Một số) phiếu thu đã xuất hóa đơn rồi. Vui lòng kiểm tra lại.", IconType.Information);
                return;
            }

            if (MsgBox.Question(Application.ProductName, "Bạn có muốn xuất hóa đơn ?") == DialogResult.No)
            {
                return;
            }

            dlgInvoiceInfo2 dlg = new dlgInvoiceInfo2(noExportedInvoiceList);

            dlg.ShowDialog();

            HighlightExportedInvoice();
        }