private void grabarloteCentroCosto() { try { //falta mostrar el ACFid Int32 total = 0; foreach (DataGridViewRow row in dataListado.Rows) { string Rta = string.Empty; Rta = NbdiXCCpExtraccionSAP_CentroCosto.SAPIMPORT( Convert.ToString(row.Cells[122].Value) //KOSTL ); if (Rta.Equals("OK")) { //MessageBox.Show("Datos agregados"); } else { //MessageBox.Show("Datos No Agregados"); break; } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void CargarCombos() { this.cbocentrodecosto.DataSource = NbdiXCCpExtraccionSAP_CentroCosto.Mostrar(); this.cbocentrodecosto.ValueMember = "KOSTL"; this.cbocentrodecosto.DisplayMember = "KOSTL"; this.cbocentrodecosto.SelectedIndex = -1; }
private void buscarNombre() { if (this.txtBuscar.Text == "") { this.mostrar(); } else { this.dataListado.DataSource = NbdiXCCpExtraccionSAP_CentroCosto.Buscar(this.txtBuscar.Text); //this.OcultarColumnas(); lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count); } }
//----------------------------------------------------------------------------------- // Actualiza Registros //----------------------------------------------------------------------------------- private void ActualizaRegistro() { string Rta = string.Empty; try { Rta = NbdiXCCpExtraccionSAP_CentroCosto.Editar(this.txtKOSTL.Text, this.txtKTEXT.Text, this.txtKLTXT.Text, this.txtMCDS3.Text); if (Rta.Equals("OK")) { this.MensajeOk("Regsitro Actualizado Correctamente"); } else { this.MensajeError("Error al Actualizar Registro "); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void mostrar() { this.Configura(); this.Activo = 1; this.tomaTab(); this.Botones(true); this.dataListado.DataSource = NbdiXCCpExtraccionSAP_CentroCosto.Mostrar(); OcultarColumnas(); lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count); if (dataListado.Rows.Count == 0) { BotonesSinReg(false); } else { BotonesSinReg(true); this.toolStripAgregar.Enabled = true; } this.dataListado.Select(); this.dataListado.Focus(); }
//----------------------------------------------------------------------------------- // Elimina Registros //----------------------------------------------------------------------------------- private void borrauno() { string Rta = string.Empty; DialogResult Opcion; Opcion = MessageBox.Show("Realmente Desea Eliminar los Registros", "Sistema de escolar", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Opcion == DialogResult.OK) { string Codigo; Codigo = Convert.ToString(this.dataListado.CurrentRow.Cells[2].Value); Rta = NbdiXCCpExtraccionSAP_CentroCosto.Eliminar(Codigo); if (Rta.Equals("OK")) { this.MensajeOk("Se Eliminó Correctamente el registro"); } else { this.MensajeError("Error al Eliminar el Registro "); } } }
private void borramuchos() { try { DialogResult Opcion; Opcion = MessageBox.Show("Realmente Desea Eliminar los Registros", "Sistema de escolar", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Opcion == DialogResult.OK) { string Codigo; string Rta = string.Empty; foreach (DataGridViewRow row in dataListado.Rows) { if (Convert.ToBoolean(row.Cells[0].Value)) { Codigo = Convert.ToString(row.Cells[2].Value); Rta = NbdiXCCpExtraccionSAP_CentroCosto.Eliminar(Codigo); if (Rta.Equals("OK")) { this.MensajeOk("Se Eliminó Correctamente el registro"); } else { this.MensajeError("Error al Eliminar el Registro ..."); } } } this.mostrar(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void BotonImprimir() { FrmReportes rptalu = new FrmReportes("Reportes\\Rpt_XCCSAPCentroCosto.rdlc", NbdiXCCpExtraccionSAP_CentroCosto.Mostrar(), "ip"); rptalu.ShowDialog(); }