private void Guardar() { try { this.objConfig.Actualizar(CGlobal.CANTIDAD_LISTA, this.numCantidad.Value.ToString()); this.objConfig.Actualizar(CGlobal.TIEMPO_LISTA, this.numTiempo.Value.ToString()); MessageBox.Show("Los valores han sido actualizados. Si la ventana que muestra las colas está abierta en este momento, debe cerrarla y abrirla de nuevo para que los cambios se apliquen", "Operación exitosa", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Ocurrió un error al intentar actualizar los valores de configuración", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); EnturnadorLIB.Enturnador.Util objUtil = new EnturnadorLIB.Enturnador.Util(); string inner = ""; if (ex.InnerException != null) inner = ex.InnerException.Message; objUtil.LogError("Camiones", "Guardar", ex.Message, inner, CGlobal.IdUsuario); } }
private void Guardar() { try { this.objConfig.Actualizar(CGlobal.CANTIDAD_LISTA, this.numCantidad.Value.ToString()); this.objConfig.Actualizar(CGlobal.TIEMPO_LISTA, this.numTiempo.Value.ToString()); MessageBox.Show("Los valores han sido actualizados. Si la ventana que muestra las colas está abierta en este momento, debe cerrarla y abrirla de nuevo para que los cambios se apliquen", "Operación exitosa", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Ocurrió un error al intentar actualizar los valores de configuración", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); EnturnadorLIB.Enturnador.Util objUtil = new EnturnadorLIB.Enturnador.Util(); string inner = ""; if (ex.InnerException != null) { inner = ex.InnerException.Message; } objUtil.LogError("Camiones", "Guardar", ex.Message, inner, CGlobal.IdUsuario); } }
private void Exportar() { if (this.dt == null) { MessageBox.Show("No hay resultados para exportar", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { StringBuilder rep = new StringBuilder(); rep.Append("<table border='1'>"); //Agrega fila con los títulos de las columnas rep.Append("<tr>"); rep.Append("<td align='center'><strong>PLACA</strong></td>"); rep.Append("<td align='center'><strong>TIPO DE CARGUE</strong></td>"); rep.Append("<td align='center'><strong>FECHA INICIAL</strong></td>"); rep.Append("<td align='center'><strong>FECHA FINAL</strong></td>"); rep.Append("<td align='center'><strong>TIEMPO</strong></td>"); rep.Append("</tr>"); //Recorre el datatable y construye taba html con los resultados for (int i = 0; i < this.dt.Rows.Count; i++) { rep.Append("<tr>"); rep.Append("<td>" + dt.Rows[i]["placa"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["tipoCargue"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["horaInicial"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["horaFinal"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["tiempo"].ToString() + "</td>"); rep.Append("</tr>"); } rep.Append("</table>"); //Nombre del archivo //24/07/2011 11:27:24 a.m. string strHora = DateTime.Now.ToString(); strHora = strHora.Replace("/", ""); strHora = strHora.Replace(":", "_"); strHora = strHora.Replace(".", ""); string nombre = "ReporteTiempoPorCiclo_" + strHora + ".xls"; string ruta = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), nombre); StreamWriter sw = new StreamWriter(ruta); sw.WriteLine(rep.ToString()); sw.Close(); MessageBox.Show("El archivo se ha creado en el escritorio, con el siguiente nombre: '" + nombre + "'", "Archivo creado", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error al crear el archivo, por favor intente de nuevo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Se guarda log del error string inner = ""; if (ex.InnerException != null) inner = ex.InnerException.Message; EnturnadorLIB.Enturnador.Util objUtil = new EnturnadorLIB.Enturnador.Util(); objUtil.LogError("ReporteTiempoPorCiclo", "Exportar", ex.Message, inner, CGlobal.IdUsuario); } }
private void Exportar() { if (this.dt == null) { MessageBox.Show("No hay resultados para exportar", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { StringBuilder rep = new StringBuilder(); rep.Append("<table border='1'>"); //Agrega fila con los títulos de las columnas rep.Append("<tr>"); rep.Append("<td align='center'><strong>PLACA</strong></td>"); rep.Append("<td align='center'><strong>TIPO DE CARGUE</strong></td>"); rep.Append("<td align='center'><strong>FECHA</strong></td>"); rep.Append("<td align='center'><strong>PTO. SENSADO</strong></td>"); rep.Append("</tr>"); //Recorre el datatable y construye taba html con los resultados for (int i = 0; i < this.dt.Rows.Count; i++) { rep.Append("<tr>"); rep.Append("<td>" + dt.Rows[i]["placa"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["tipoCargue"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["hora"].ToString() + "</td>"); rep.Append("<td>" + dt.Rows[i]["puerta"].ToString() + "</td>"); rep.Append("</tr>"); } rep.Append("</table>"); //Nombre del archivo //24/07/2011 11:27:24 a.m. string strHora = DateTime.Now.ToString(); strHora = strHora.Replace("/", ""); strHora = strHora.Replace(":", "_"); strHora = strHora.Replace(".", ""); string nombre = "ReporteTrazabilidad_" + strHora + ".xls"; string ruta = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), nombre); StreamWriter sw = new StreamWriter(ruta); sw.WriteLine(rep.ToString()); sw.Close(); MessageBox.Show("El archivo se ha creado en el escritorio, con el siguiente nombre: '" + nombre + "'", "Archivo creado", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show("Ha ocurrido un error al crear el archivo, por favor intente de nuevo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); //Se guarda log del error string inner = ""; if (ex.InnerException != null) { inner = ex.InnerException.Message; } EnturnadorLIB.Enturnador.Util objUtil = new EnturnadorLIB.Enturnador.Util(); objUtil.LogError("ReporteTrazabilidad", "Exportar", ex.Message, inner, CGlobal.IdUsuario); } }
public LLRPReadControl() { tags = new Hashtable(); this.obJCola = new EnturnadorLIB.Enturnador.Cola(); this.objUtil = new EnturnadorLIB.Enturnador.Util(); }
public LLRPReadControl() { tags = new Hashtable(); this.obJCola = new EnturnadorLIB.Enturnador.Cola(); this.objUtil = new EnturnadorLIB.Enturnador.Util(); }