private void OnElapsedTime(object source, ElapsedEventArgs e) { if (DateTime.Now.Hour == 8 && DateTime.Now.Minute < 6) { SapConnector vSapConnection = new SapConnector(); int vResult = vSapConnection.updateEmployees(DateTime.Now); } if (Convert.ToBoolean(ConfigurationManager.AppSettings["TestServicio"])) { this.WriteToFile("Test de servicio {0}"); } if (Convert.ToBoolean(ConfigurationManager.AppSettings["ProcesoNormal"])) { DataTable vDatos = vConexion.obtenerDataTable("RSP_ObtenerRelojes 1"); foreach (DataRow item in vDatos.Rows) { vKeeper.SetCommPassword(Convert.ToInt32(item["compass"].ToString())); vConnect = vKeeper.Connect_Net(item["ip"].ToString(), Convert.ToInt32(item["puerto"].ToString())); if (vConnect) { ObtenerData(item["ciudad"].ToString()); } vKeeper.Disconnect(); } } else { this.WriteToFile("Test de servicio apagado {0}"); } }
protected void Unnamed_Click(object sender, EventArgs e) { string vError = ""; try{ SapConnector vSapConnection = new SapConnector(); int vResult = vSapConnection.updateEmployees(DateTime.Now); if (vResult > 0) { Mensaje("Se actualizaron: <b>" + vResult + "</b> registros", WarningType.Success); } }catch (Exception ex) { vError = ex.Message; } }