private void txtNumber_TextChanged(object sender, EventArgs e)
 {
     try
     {
         ToWord toWord = new ToWord(Convert.ToDecimal(txtNumber.Text), currencies[Convert.ToInt32(cboCurrency.SelectedValue)]);
         txtEnglishWord.Text = toWord.ConvertToEnglish();
         txtArabicWord.Text  = toWord.ConvertToArabic();
     }
     catch (Exception ex)
     {
         txtEnglishWord.Text = String.Empty;
         txtArabicWord.Text  = String.Empty;
     }
 }
Пример #2
0
        private void toword()
        {
            IFormater formater = new GradeFormater();

            if (cboCurrency.SelectedIndex == 1)
            {
                formater = new GrammFormater();
            }

            try
            {
                txtArabicWord.Text = ToWord.ToArabic(long.Parse(txtNumber.Text), formater);
            }
            catch (Exception ex)
            {
                txtArabicWord.Text = ex.Message;
            }
        }
        protected void uiLinkButtonPrint_Click(object sender, EventArgs e)
        {
            ToWord toWord = new ToWord(CurrentVoucher.Amount, new CurrencyInfo(CurrencyInfo.Currencies.SaudiArabia));

            CurrentVoucher.AddColumn("NumberWord", typeof(string));
            CurrentVoucher.SetColumn("NumberWord", toWord.ConvertToArabic());

            uiReportViewerMain.Reset();
            uiReportViewerMain.LocalReport.ReportPath = "ReportsFiles/RPT_PaymentVoucher.rdlc";
            uiReportViewerMain.LocalReport.DataSources.Clear();
            uiReportViewerMain.LocalReport.DataSources.Add(new ReportDataSource("PaymentDataSet", CurrentVoucher.DefaultView));
            uiReportViewerMain.LocalReport.Refresh();
        }