private void invoiceDetailsBtn_Click(object sender, EventArgs e)
        {
            if ((AnonUnPaidInvoice)multipleReceiptView.GetFocusedRow() != null)
            {
                var currentRow = (AnonUnPaidInvoice)multipleReceiptView.GetFocusedRow();

                Cursor.Current = Cursors.WaitCursor;
                var newConnection = new dbContextDataContext();

                var currentInvoice = newConnection.tblInvoices.Where(i => i.InvoiceNo == currentRow.InvoiceNo).SingleOrDefault();
                if (currentInvoice != null)
                {
                    var newInvoice = new Accounting.Invoice.newInvoiceForm(currentInvoice);
                    newInvoice.ShowDialog();

                    if (newInvoice.DialogResult == DialogResult.OK)
                        updateForm();
                    newInvoice.Dispose();
                }
                else
                {
                    MessageBox.Show("Data corrupt, can not retrieve invoice.");
                }

            }
            else
                this.DialogResult = DialogResult.Retry;
        }
        private void invoiceDetailsBtn_Click(object sender, EventArgs e)
        {
            if ((getClaimantInvoicesResult)claimantInvoicesView.GetFocusedRow() != null)
            {
                    var currentRow = (getClaimantInvoicesResult)claimantInvoicesView.GetFocusedRow();
                    var newConnection = new dbContextDataContext();
                    var currentInvoice = newConnection.tblInvoices.Where(i => i.InvoiceNo == currentRow.InvoiceNo).SingleOrDefault();

                    if (currentInvoice != null)
                    {
                        var viewInvoice = new Accounting.Invoice.newInvoiceForm(currentInvoice);
                        viewInvoice.ShowDialog();
                        if (viewInvoice.DialogResult == DialogResult.OK)
                        {
                            updateForm();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Data corrupt, can not retrieve invoice.");
                    }

            }
            else
                this.DialogResult = DialogResult.Retry;
        }
Exemple #3
0
        private void invoiceBtn_Click(object sender, EventArgs e)
        {
            var currentRow = (AnonWaitingRoom)waitingRoomGridView.GetFocusedRow();

            if (currentRow != null)
            {
                    var claimantChoose = new Accounting.Invoice.claimantSelectViewForm(currentRow.ID);
                    claimantChoose.ShowDialog();
                    if (claimantChoose.DialogResult == DialogResult.OK)
                    {
                        var newConnection = new dbContextDataContext();
                        var currentPhysio = newConnection.tblPhysios.Where(physio => physio.PhysioID == currentRow.Physio).FirstOrDefault();
                        var newInvoice = new Accounting.Invoice.newInvoiceForm(claimantChoose.myClaimant, currentPhysio);
                        newInvoice.ShowDialog();
                    }
            }
            else
            {
                MessageBox.Show("Please Select a Patient first!");
            }
        }
 private void newInvoiceBtn_Click(object sender, EventArgs e)
 {
     var physioChoose = new Scheduling.physioSelectDialog();
     physioChoose.ShowDialog();
     if (physioChoose.DialogResult == DialogResult.OK)
     {
         var viewInvoice = new Accounting.Invoice.newInvoiceForm(this.myClaimant, physioChoose.myPhysio);
         viewInvoice.ShowDialog();
         if (viewInvoice.DialogResult == DialogResult.OK)
         {
             updateForm();
         }
     }
 }