示例#1
0
        private void BtnSelectSubject_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (exists)
                {
                    payerImpl = new PayerImpl();
                    payer     = payerImpl.Get(txtnit.Text);

                    if (payer.IdPayer > -1)
                    {
                        lblbuss.Content = payer.BusinessName;
                        idPayer         = payer.IdPayer;
                    }
                    else
                    {
                        btnAdd.Height  = 40; btnAdd.Width = 100;
                        lblbuss.Height = 0; lblbuss.Width = 0;
                        txtBuss.Height = 40; txtBuss.Width = 164;
                        exists         = false;
                    }
                }
                else
                {
                    btnAdd.Height  = 0; btnAdd.Width = 0;
                    lblbuss.Height = 40; lblbuss.Width = 164;
                    txtBuss.Height = 0; txtBuss.Width = 0;
                    exists         = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         payerImpl = new PayerImpl();
         payerImpl.InsertTransaction(txtnit.Text, txtBuss.Text);
         MessageBox.Show("Payer Insert");
         btnAdd.Height  = 0; btnAdd.Width = 0;
         lblbuss.Height = 40; lblbuss.Width = 164;
         txtBuss.Height = 0; txtBuss.Width = 0;
         exists         = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something was wrong");
     }
 }