Example #1
0
        private void CarregaSede()
        {
            SedeDAL sDAL = new SedeDAL();
            Sede    s    = sDAL.RetornaSede();

            if (s != null)
            {
                lblIdSede.Text       = s.Id.ToString();
                txtNmFantasia.Text   = s.NomeFantasia;
                txtRazaoSocial.Text  = s.RazaoSocial;
                mskCnpj.Text         = s.Cnpj;
                txtInscEstadual.Text = s.InscricaoEstadual;
                txtEndereco.Text     = s.Endereco;
                txtNumero.Text       = s.Numero;
                txtBairro.Text       = s.Bairro;
                txtCidade.Text       = s.Cidade;
                cmbUfEndereco.Text   = s.Uf;
                mskTelefone.Text     = s.Telefone;
                txtEmail.Text        = s.Email;
            }
        }
Example #2
0
 private void Sede()
 {
     try
     {
         SedeDAL sDAL = new SedeDAL();
         Sede    s    = new Sede
         {
             NomeFantasia      = txtNmFantasia.Text,
             RazaoSocial       = txtRazaoSocial.Text,
             Cnpj              = mskCnpj.Text,
             InscricaoEstadual = txtInscEstadual.Text,
             Endereco          = txtEndereco.Text,
             Numero            = txtNumero.Text,
             Bairro            = txtBairro.Text,
             Cidade            = txtCidade.Text,
             Uf       = cmbUfEndereco.Text,
             Telefone = mskTelefone.Text,
             Email    = txtEmail.Text
         };
         if (lblIdSede.Text.Equals("idSede"))
         {
             sDAL.InsertSede(s);
         }
         else
         {
             s.Id = int.Parse(lblIdSede.Text);
             sDAL.UpdateSede(s);
         }
         CarregaSede();
     }
     catch (SystemException ex)
     {
         string exception;
         exception = ex.Message;
         frmTDM_Menssagem frm = new frmTDM_Menssagem("Revise os dados", 2, exception);
         frm.ShowDialog();
     }
 }
Example #3
0
 public MantenimientoSedes()
 {
     InitializeComponent();
     sebol = new SedeBOL();
     sedal = new SedeDAL();
 }