private void toolStripGuardar_Click(object sender, EventArgs e) { string Rta = string.Empty; Int32 i; MessageBox.Show("insertar"); try { for (i = 0; i < dataListado.Rows.Count; i++) { Rta = NacfCRSt_Caracteristicas.EditarSustitucionMejora( this.dataListado.Rows[i].Cells[0].Value.ToString() , this.dataListado.Rows[i].Cells[1].Value.ToString() , this.dataListado.Rows[i].Cells[2].Value.ToString() , this.dataListado.Rows[i].Cells[3].Value.ToString() , this.dataListado.Rows[i].Cells[4].Value.ToString() , this.dataListado.Rows[i].Cells[5].Value.ToString() , this.dataListado.Rows[i].Cells[6].Value.ToString() , this.dataListado.Rows[i].Cells[7].Value.ToString() , this.dataListado.Rows[i].Cells[8].Value.ToString() , this.dataListado.Rows[i].Cells[9].Value.ToString() , this.dataListado.Rows[i].Cells[10].Value.ToString() , this.dataListado.Rows[i].Cells[11].Value.ToString() , this.dataListado.Rows[i].Cells[12].Value.ToString() , this.dataListado.Rows[i].Cells[13].Value.ToString() , this.dataListado.Rows[i].Cells[14].Value.ToString() , this.dataListado.Rows[i].Cells[15].Value.ToString() ); if (Rta.Equals("OK")) { this.MensajeOk("Regsitro Agregado Correctamente"); } else { this.MensajeError("Error al Insertar Registro :" + Rta); } } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void toolStripAgregar_Click(object sender, EventArgs e) { string iACFid = Microsoft.VisualBasic.Interaction.InputBox( "Ingrese el Id del Activo Fijo", "Ajuste del Valor del Bien"); if (iACFid != null) { //dataListado.DataSource = NacfACFp_Activo_Fijo.Mostrar2(iACFid); DataTable tabla = NacfCRSt_Caracteristicas.MostrarSustitucionMejora(iACFid); if (tabla.Rows.Count > 0) { foreach (DataRow Drow in tabla.Rows) { int num = dataListado.Rows.Add(); dataListado.Rows[num].Cells[0].Value = Drow["ACFid"].ToString(); dataListado.Rows[num].Cells[1].Value = Drow["MARid"].ToString(); dataListado.Rows[num].Cells[2].Value = Drow["CRSserie"].ToString(); dataListado.Rows[num].Cells[3].Value = Drow["CRSmodelo"].ToString(); dataListado.Rows[num].Cells[4].Value = Drow["CRScolor"].ToString(); dataListado.Rows[num].Cells[5].Value = Drow["CRSresolucion"].ToString(); dataListado.Rows[num].Cells[6].Value = Drow["CRScapacidad"].ToString(); dataListado.Rows[num].Cells[7].Value = Drow["CRSpotencia"].ToString(); dataListado.Rows[num].Cells[8].Value = Drow["CRSvnominal"].ToString(); dataListado.Rows[num].Cells[9].Value = Drow["CRSventrada"].ToString(); dataListado.Rows[num].Cells[10].Value = Drow["CRSvsalida"].ToString(); dataListado.Rows[num].Cells[11].Value = Drow["CRSfrecuencia"].ToString(); dataListado.Rows[num].Cells[12].Value = Drow["CRStemperatura"].ToString(); dataListado.Rows[num].Cells[13].Value = Drow["CRSprocesador"].ToString(); dataListado.Rows[num].Cells[14].Value = Drow["CRSpuertos"].ToString(); dataListado.Rows[num].Cells[15].Value = Drow["CRSobservacion"].ToString(); } } else { MessageBox.Show("No Existe", "Registro"); } } }
private void mostraracf(string variableid) { try { DataTable dat = NacfCRSt_Caracteristicas.mostrarconciliar(variableid); //DataTable dat = NacfINVp_Inventario.Next(iINVid); //MessageBox.Show(variableid); if (dat.Rows.Count > 0) { //MessageBox.Show(variableid); DataRow row = dat.Rows[0]; //características txtacfserie.Text = Convert.ToString(row["CRSserie"]); txtacfmarca.Text = Convert.ToString(row["MARid"]); txtacfmodelo.Text = Convert.ToString(row["CRSmodelo"]); txtacfcantidad.Text = Convert.ToString(row["CRScantidad"]); txtacfunidad.Text = Convert.ToString(row["UNMid"]); //electrico txtacfgis.Text = Convert.ToString(row["UBEcodigogis"]); txtacfelectrico.Text = Convert.ToString(row["SELid"]); txtacfset.Text = Convert.ToString(row["UBEsetetq"]); txtacfalimentador.Text = Convert.ToString(row["UBEalimentadoretq"]); txtacfsed.Text = Convert.ToString(row["UBEsedetq"]); txtacfcircuito.Text = Convert.ToString(row["UBEcircuitoetq"]); txtacfinicio.Text = Convert.ToString(row["UBEpuntoietq"]); txtacffin.Text = Convert.ToString(row["UBEpuntofetq"]); //terrenos y edificaciones txtacffichapredio.Text = Convert.ToString(row["CRSfinscpredio"]); txtacfficharegistral.Text = Convert.ToString(row["CRSficharegistral"]); txtacfareaconstruida.Text = Convert.ToString(row["CRSareaconstruida"]); txtacfperimetro.Text = Convert.ToString(row["CRSperimetro"]); txtacfusopredio.Text = Convert.ToString(row["CRSusopredio"]); //vehículos txtacfplaca.Text = Convert.ToString(row["CRSvehplaca"]); txtacfexpediente.Text = Convert.ToString(row["CRSvehexpediente"]); txtacfinscripcion.Text = Convert.ToString(row["CRSvehinscripcion"]); txtacfclase.Text = Convert.ToString(row["CRSvehclase"]); txtacfcombustible.Text = Convert.ToString(row["CRSvehcombustible"]); txtacfejes.Text = Convert.ToString(row["CRSvehejes"]); txtacfpasajeros.Text = Convert.ToString(row["CRSvehpasajeros"]); txtacfasientos.Text = Convert.ToString(row["CRSvehasientos"]); txtacfpeso.Text = Convert.ToString(row["CRSvehpesoseco"]); txtacfcarga.Text = Convert.ToString(row["CRSvehcargautil"]); txtacfaltura.Text = Convert.ToString(row["CRSaltura"]); txtacfancho.Text = Convert.ToString(row["CRSancho"]); //equipos txtacfvelocidad.Text = Convert.ToString(row["CRSvelocidad"]); txtacfresolucion.Text = Convert.ToString(row["CRSresolucion"]); txtacfcapacidad.Text = Convert.ToString(row["CRScapacidad"]); txtacfpotencia.Text = Convert.ToString(row["CRSpotencia"]); txtacfnominal.Text = Convert.ToString(row["CRSvnominal"]); txtacfentrada.Text = Convert.ToString(row["CRSventrada"]); txtacfsalida.Text = Convert.ToString(row["CRSvsalida"]); txtacffrecuencia.Text = Convert.ToString(row["CRSfrecuencia"]); txtacftemperatura.Text = Convert.ToString(row["CRStemperatura"]); txtacfprocesador.Text = Convert.ToString(row["CRSprocesador"]); txtacfpuertos.Text = Convert.ToString(row["CRSpuertos"]); } else { MessageBox.Show("No Existe", "Registro"); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void grabarloteCARAC() { try { //falta mostrar el ACFid Int32 total = 0; foreach (DataGridViewRow row in dataListado.Rows) { string Rta = string.Empty; Rta = NacfCRSt_Caracteristicas.SAPIMPORT( Convert.ToString(row.Cells[3].Value), // ACFid "0", // MARid Convert.ToString(row.Cells[52].Value), // ESTid "", // CRSserie Convert.ToString(row.Cells[55].Value), // CRSmodelo Convert.ToString(row.Cells[56].Value), // CRScolor "0", // MATid "", // CRStipo "0", // UNMid Convert.ToString(row.Cells[54].Value), // CRScantidad Convert.ToString(row.Cells[58].Value), // CRSvehplaca Convert.ToString(row.Cells[60].Value), // CRSvehexpediente Convert.ToString(System.DateTime.Today), //Convert.ToString(row.Cells[61].Value), // CRSvehinscripcion Convert.ToString(row.Cells[62].Value), // CRSvehclase Convert.ToString(row.Cells[63].Value), // CRSvehcombustible "0", // Convert.ToString(row.Cells[64].Value), // CRSvehejes "0", // Convert.ToString(row.Cells[65].Value), // CRSvehpasajeros "0", // Convert.ToString(row.Cells[66].Value), // CRSvehasientos "0", // Convert.ToString(row.Cells[67].Value), // CRSvehpesoseco "0", // Convert.ToString(row.Cells[68].Value), // CRSvehcargautil "0", // Convert.ToString(row.Cells[69].Value), // CRSaltura "0", // Convert.ToString(row.Cells[70].Value), // CRSancho Convert.ToString(row.Cells[76].Value), // CRSvelocidad "", // CRSresolucion "", // CRScapacidad Convert.ToString(row.Cells[77].Value), // CRSpotencia Convert.ToString(row.Cells[79].Value), // CRSvnominal Convert.ToString(row.Cells[78].Value), // CRSventrada Convert.ToString(row.Cells[80].Value), // CRSvsalida Convert.ToString(row.Cells[81].Value), // CRSfrecuencia Convert.ToString(row.Cells[82].Value), // CRStemperatura Convert.ToString(row.Cells[83].Value), // CRSprocesador Convert.ToString(row.Cells[84].Value), // CRSpuertos "0", // Convert.ToString(row.Cells[71].Value), // CRSutmx "0", // Convert.ToString(row.Cells[72].Value), // CRSutmy Convert.ToString(row.Cells[73].Value), // CRSesfuerzopunta Convert.ToString(row.Cells[74].Value), // CRScajaderivadora Convert.ToString(row.Cells[75].Value), // CRSalquilacable Convert.ToString(row.Cells[86].Value), // CRScentropoblado Convert.ToString(row.Cells[87].Value), // CRSurbanizacion Convert.ToString(row.Cells[88].Value), // CRScalle Convert.ToString(row.Cells[89].Value), // CRSlote Convert.ToString(row.Cells[90].Value), // CRSnumeropredio Convert.ToString(row.Cells[91].Value), // CRSdepartamento Convert.ToString(row.Cells[92].Value), // CRSinterior Convert.ToString(row.Cells[94].Value), // CRScarretera "0", // Convert.ToString(row.Cells[93].Value), // CRSkilometro Convert.ToString(row.Cells[95].Value), // CRSnombrepredio "0", // Convert.ToString(row.Cells[96].Value), // CRSpisospredio "", // CRSpartidapredio "", // CRStomopredio "", // CRSfolioinipredio "", // CRSfoliofinpredio "", // CRSasientopredio Convert.ToString(System.DateTime.Today), //"", // CRSfinscpredio Convert.ToString(row.Cells[98].Value), // CRSficharegistral "0", // Convert.ToString(row.Cells[103].Value), // CRSareaconstruida "0", // Convert.ToString(row.Cells[104].Value), // CRSperimetro "", // CRSusopredio "0", // CRSvalorautovaluo "", // CRScodigoluz "", // CRScodigoagua Convert.ToString(System.DateTime.Today), //"", // CRSfadqpredio Convert.ToString(row.Cells[85].Value) // CRSobservacion ); if (Rta.Equals("OK")) { //MessageBox.Show("Datos agregados"); } else { //MessageBox.Show("Datos No Agregados"); break; } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }