Example #1
0
        private void frmEmpresa_Load(object sender, EventArgs e)
        {
            btnModificar.Enabled = false;

            cmbCategoriaAfip.DataSource = Negocios.FuncionesGlobales.AfipS.ObtenerCategoriasAfip(null);
            cmbCategoriaAfip.DisplayMember = "Nombre";
            cmbCategoriaAfip.ValueMember = "IdCategoriaafip";
            _Empresa = new EmpresaN();
            if (_Empresa.Succed == true)
            {
                txtNombre.Text = _Empresa.RazonSocial;
                txtIngBrut.Text = _Empresa.IngresosBrutos;
                txtNomFant.Text = _Empresa.NombreFantasia;
                txtCUIT.Text = _Empresa.Cuit;
                dtpInicioActi.Text = _Empresa.InicioActividad.ToShortDateString();
                btnEliminar.Enabled = true;
                btnModificar.Enabled = true;
                cmbCategoriaAfip.SelectedValue = _Empresa.CategoriaAFIP;
            }

            else
            {
                btnEliminar.Enabled = false;
                MessageBox.Show("Establezca su empresa");
            }
            
        }
Example #2
0
 private void btnGrabar_Click(object sender, EventArgs e)
 {
     if (ControlErrores())
     {
         _Empresa = new EmpresaN(txtNombre.Text,
                                 txtNomFant.Text, 
                                 txtCUIT.Text, 
                                 txtIngBrut.Text, 
                                 DateTime.Parse(dtpInicioActi.Text), 
                                 int.Parse(cmbCategoriaAfip.SelectedValue.ToString()));
     
         MessageBox.Show("Grabo con exito");
         btnEliminar.Enabled = true;
         btnModificar.Enabled = true;
         btnGrabar.Enabled = false;
     }
     else
     {
         MessageBox.Show("Revise los campos e intente nuevamente.\nSi el problema persiste contacte a sus programadores");
     }
 }