Esempio n. 1
0
        protected void gvInvoices_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int InvoiceID = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "PrintPremium")
            {
                try
                {
                    PrintInvoice(InvoiceID, 1);
                }
                catch (Exception ex)
                {
                    this.ShowMessage(ref lblMessage, MessageType.Danger, ex.Message);
                }
            }
            else if (e.CommandName == "PrintFullPremium")
            {
                try
                {
                    PrintInvoice(InvoiceID, 2);
                }
                catch (Exception ex)
                {
                    this.ShowMessage(ref lblMessage, MessageType.Danger, ex.Message);
                }
            }
            else if (e.CommandName == "PaymentReversal")
            {
                int PaymentID = client.AddReversalPayments(InvoiceID, this.UserName, this.ParlourId);
                if (PaymentID != 0)
                {
                    Guid ParlourId = new Guid(Request.QueryString["ParlourId"]);
                    bindInvoices(ParlourId, MemberId);
                    Common.WebMsgBox.Show("Reversal added successfully.");
                }
                else
                {
                    Common.WebMsgBox.Show("Reversal not added successfully.");
                }
            }
        }