예제 #1
0
        ///	<summary>
        /// Add Invoice
        ///	</summary>
        private int AddInvoice()
        {
            int invoiceId = 0;

            Facade.IInvoiceOneLiner facInvoice = new Facade.Invoice();

            string userName = ((Entities.CustomPrincipal)Page.User).UserName;

            invoiceId = facInvoice.CreateOneLiner(m_Invoice, this.txtNETAmount.Culture.LCID, Convert.ToInt32(cboClient.SelectedValue), userName);

            if (invoiceId == 0)
            {
                lblConfirmation.Text      = "There was an error adding the Invoice, please try again.";
                lblConfirmation.Visible   = true;
                lblConfirmation.ForeColor = Color.Red;
            }
            else
            {
                // NO NEED: Alreayd done within the Data Access Layer.

                // Reference Invoice Id With Client
                //int clientId = Convert.ToInt32(cboClient.SelectedValue);
                //Facade.IInvoiceOneLiner facInv = new Facade.Invoice();
                //facInv.CreateInvoiceIdWithClientId(invoiceId, clientId);
                // Done in the Data Access Layer.
            }

            return(invoiceId);
        }