// *********************************** private void GravaVelocidadeComp(RegTamVel2 obj241, int[] obj241_vel, string strtab, int lane) { ConectaBancoClassfic(); // string strtab = "tbvelhoradia" + obj241.aRod + "km" + obj241.oKm; //strtab= "tbvelhoradia" + "RJ106" + "km" + obj241.oKm; // soma os 3 comprimentos // obj241_vel[ind1] = obj241.dta[iahora, 1, 1, ind1] + obj241.dta[iahora, 1, 2, ind1] + obj241.dta[iahora, 1, 3, ind1]; int iahora = Int32.Parse(obj241.aHora); for (int ind1 = 1; ind1 <= 3; ind1++) { comcfc1.CommandText = "insert into " + strtab + " (Rod, DI, MO, YE, HO, Sent, km, comp, Vel19, Vel29, Vel39,"; comcfc1.CommandText = comcfc1.CommandText + " Vel49, Vel59, Vel69, Vel79, Vel89, Vel99,"; comcfc1.CommandText = comcfc1.CommandText + " Vel109, Vel119, Vel129, Vel139, Vel199) "; comcfc1.CommandText = comcfc1.CommandText + "Values (" + "'" + obj241.aRod + "'" + "," + "'" + obj241.oDa + "'" + "," + "'" + obj241.oMes + "'" + "," + "'" + obj241.oAno + "'" + "," + "'" + obj241.aHora + "'" + ","; comcfc1.CommandText = comcfc1.CommandText + "'" + obj241.oStrSent + "'" + "," + "'" + obj241.oKm + "'" + "," + ind1 + "," + obj241.dta[iahora, lane, ind1, 1] + "," + obj241.dta[iahora, lane, ind1, 2] + "," + obj241.dta[iahora, lane, ind1, 3] + "," + obj241.dta[iahora, lane, ind1, 4] + ","; comcfc1.CommandText = comcfc1.CommandText + obj241.dta[iahora, lane, ind1, 5] + "," + obj241.dta[iahora, lane, ind1, 6] + "," + obj241.dta[iahora, lane, ind1, 7] + "," + obj241.dta[iahora, lane, ind1, 8] + "," + obj241.dta[iahora, lane, ind1, 9] + ","; comcfc1.CommandText = comcfc1.CommandText + obj241.dta[iahora, lane, ind1, 10] + "," + obj241.dta[iahora, lane, ind1, 11] + "," + obj241.dta[iahora, lane, ind1, 12] + "," + obj241.dta[iahora, lane, ind1, 13] + "," + obj241.dta[iahora, lane, ind1, 14] + ")"; comcfc1.ExecuteNonQuery(); } DesconectaBanco(); }
// *********************************** private void GravaComprimento(RegTamVel2 obj241, string strtab, int lane) { int iahora = Int32.Parse(obj241.aHora); ConectaBancoClassfic(); comcfc1.CommandText = "insert into " + strtab + "(Rod, DI, MO, YE, HO, Sent, km, comp1, comp2, comp3)"; comcfc1.CommandText = comcfc1.CommandText + "Values (" + "'" + obj241.aRod + "'" + "," + "'" + obj241.oDa + "'" + "," + "'" + obj241.oMes + "'" + "," + "'" + obj241.oAno + "'" + "," + "'" + obj241.aHora + "'" + ","; comcfc1.CommandText = comcfc1.CommandText + "'" + obj241.oStrSent + "'" + "," + "'" + obj241.oKm + "'" + "," + obj241.dta[iahora, lane, 1, 1] + "," + obj241.dta[iahora, lane, 2, 1] + "," + obj241.dta[iahora, lane, 3, 1] + ")"; comcfc1.ExecuteNonQuery(); DesconectaBanco(); }
// *********************************** // *********************************** private void GravaVelocidade(RegTamVel2 obj241, int[] obj241_vel, string strtab) { ConectaBancoClassfic(); // string strtab = "tbvelhoradia" + obj241.aRod + "km" + obj241.oKm; //strtab= "tbvelhoradia" + "RJ106" + "km" + obj241.oKm; comcfc1.CommandText = "insert into " + strtab + " (Rod, DI, MO, YE, HO, Sent, km, Vel19, Vel29, Vel39,"; comcfc1.CommandText = comcfc1.CommandText + " Vel49, Vel59, Vel69, Vel79, Vel89, Vel99,"; comcfc1.CommandText = comcfc1.CommandText + " Vel109, Vel119, Vel129, Vel139, Vel199) "; comcfc1.CommandText = comcfc1.CommandText + "Values (" + "'" + obj241.aRod + "'" + "," + "'" + obj241.oDa + "'" + "," + "'" + obj241.oMes + "'" + "," + "'" + obj241.oAno + "'" + "," + "'" + obj241.aHora + "'" + ","; comcfc1.CommandText = comcfc1.CommandText + "'" + obj241.oStrSent + "'" + "," + "'" + obj241.oKm + "'" + "," + obj241_vel[1] + "," + obj241_vel[2] + "," + obj241_vel[3] + "," + obj241_vel[4] + ","; comcfc1.CommandText = comcfc1.CommandText + obj241_vel[5] + "," + obj241_vel[6] + "," + obj241_vel[7] + "," + obj241_vel[8] + "," + obj241_vel[9] + ","; comcfc1.CommandText = comcfc1.CommandText + obj241_vel[10] + "," + obj241_vel[11] + "," + obj241_vel[12] + "," + obj241_vel[13] + "," + obj241_vel[14] + ")"; comcfc1.ExecuteNonQuery(); DesconectaBanco(); }