Ejemplo n.º 1
0
 private void btnGuardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     int vEmpresaId = 1;
     string vEmpresaNombre = txtEmpresaNombre.Text;
     string vEmpresaFiscal = txtEmpresaFiscal.Text;
     string vEmpresaCalle = txtCalle.Text;
     string vEmpresaNExterior = txtNExt.Text;
     string vEmpresaNInterior = txtNInt.Text;
     string vEmpresaColonia = txtColonia.Text;
     string vEmpresaCP = txtCP.Text;
     string vEmpresaCiudad = txtCiudad.Text;
     string vEmpresaRFC = txtRFC.Text;
     string vEmpresaRegSAGARPA = txtRegSagarpa.Text;
     string vEmpresaRepresentante = txtRepresentante.Text;
     string vEmpresaPoblacion = txtPoblacion.Text;
     string vEmpresaMunicipio = txtMunicipio.Text;
     int vEstadosId = Convert.ToInt32(cmbEstado.SelectedValue.ToString());
     Empresa GuardarEmp = new Empresa();
     if (txtEmpresaId.Text == string.Empty)
     {
         GuardarEmp.AgregarEmpresa(vEmpresaId, vEmpresaNombre, vEmpresaFiscal, vEmpresaCalle, vEmpresaNExterior, vEmpresaNInterior, vEmpresaColonia, vEmpresaCP, vEmpresaCiudad, vEmpresaRFC, vEmpresaRegSAGARPA, vEmpresaRepresentante, vEmpresaPoblacion, vEmpresaMunicipio, vEstadosId);
     }
     else
     {
         GuardarEmp.ModificarEmpresa(vEmpresaId, vEmpresaNombre, vEmpresaFiscal, vEmpresaCalle, vEmpresaNExterior, vEmpresaNInterior, vEmpresaColonia, vEmpresaCP, vEmpresaCiudad, vEmpresaRFC, vEmpresaRegSAGARPA, vEmpresaRepresentante, vEmpresaPoblacion, vEmpresaMunicipio, vEstadosId);
     }
     MessageBox.Show("La Empresa se ha Actualizado con exito");
     BloquearObjetos(false);
 }