protected void btnInvoice_Click(object sender, ImageClickEventArgs e) { if (sn == null) { return; } if (sn.Invoice == null) { if (CntAriCli.ContainsTicketsInvoiced(sn, ctx)) { RadAjaxManager1.ResponseScripts.Add(String.Format("showDialog('{0}','{1}','error',null,0,0);" , Resources.GeneralResource.Error , Resources.GeneralResource.ContainsTicketsInvoiced)); return; } int invoiceId = CntAriCli.InvoiceServiceNote(sn, ctx); Invoice i = CntAriCli.GetInvoice(invoiceId, ctx); if (i != null) { RadAjaxManager1.ResponseScripts.Add(String.Format("EditInvoiceRecord({0});", i.InvoiceId)); } else { RadAjaxManager1.ResponseScripts.Add(String.Format("showDialog('{0}','{1}','error',null,0,0);" , Resources.GeneralResource.Error , Resources.GeneralResource.InvoiceError)); } } else { RadAjaxManager1.ResponseScripts.Add(String.Format("EditInvoiceRecord({0});", sn.Invoice.InvoiceId)); } }