Skip to content

Instantly share code, notes, and snippets.

@jofese
Created August 4, 2017 00:20
Show Gist options
  • Save jofese/2e40c3b053a8e1f84cd77adc89ca19e9 to your computer and use it in GitHub Desktop.
Save jofese/2e40c3b053a8e1f84cd77adc89ca19e9 to your computer and use it in GitHub Desktop.
private void UIMenuPrincipal_Load(object sender, EventArgs e)
{
cls_Versiones oVersiones = new cls_Versiones();
oVersiones.Hostname = Environment.MachineName;
oVersiones.Sia = cls_VariablesGlobales.versionaplicativo;
oVersiones.UltimoAcceso = DateTime.Now;
oVersiones.Usuario = Environment.UserName;
oVersiones.IP = GetLocalIPv4(NetworkInterfaceType.Ethernet);
if (objVersiones.getOne(oVersiones.Hostname))
objVersiones.ActualizarSia(oVersiones);
else
objVersiones.InsertarSia(oVersiones);
//Assembly.Load(@"C:\Archivos de programa\Archivos comunes\CrystalDecisions\2.5\managed\CrystalDecisions.CrystalReports.Engine.dll");
//Assembly.LoadFrom(@"C:\Windows\assembly\CrystalDecisions.CrystalReports.Engine.dll, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304");
// cargar de la misma forma otros ensamblados de Crystal
this.Text = "SIA ADMIN " + cls_VariablesGlobales.versionaplicativo + " Menu Principal";
CheckForIllegalCrossThreadCalls = false;
this.tslFechaLetras.Text = cls_VariablesGlobales.Traducir(DateTime.Today.DayOfWeek.ToString().ToUpper()) + " " + DateTime.Today.ToShortDateString();
this.toolStripStatusLabel6.Text = cls_VariablesGlobales.nombrecompletousuario;
DirectoryInfo dir = new DirectoryInfo(Environment.CurrentDirectory);
foreach (FileInfo di in dir.GetFiles())
{
if (di.Name == "Asistencia.Asistencia.exe")
this.tspActualizacion.Text = di.LastWriteTime.ToString();
else if (di.Name == "SIA.exe")
this.tspActualizacion.Text = di.LastWriteTime.ToString();
}
this.BackgroundImage = Image.FromFile(Environment.CurrentDirectory + @"\iconos\Fondo_Final.jpg");
BackgroundImageLayout = ImageLayout.Stretch;
this.RecorrerEstructuraMenu(this.menuStrip);
//this.RecorrerEstructuraToolStrip(this.toolStrip);
if (cls_VariablesGlobales.sucursal == "chocope")
{
}
else
{
cls_ControlDAO obj2 = new cls_ControlDAO();
DS_Asistencia Cambio = obj2.buscarfecha(DateTime.Today);
foreach (DS_Asistencia.Sistema_ControlRow fila2 in Cambio.Sistema_Control.Rows)
cls_VariablesGlobales.control = fila2.Valor;
if (cls_VariablesGlobales.control.ToString() == "" || cls_VariablesGlobales.control == 0)
{
//UICambio.CreateInstance(this);
string cadena2 = Application.StartupPath + @"\Configuracion.ini";
string[] tContenidos3;
tContenidos3 = objArray.IniGetSection(cadena2, "Correo_Tickets");
if (tContenidos3.Length > 0)
{
int j;
for (j = 0; j < tContenidos3.Length; j += 2)
{
correo = tContenidos3[j];
}
}
string[] tContenidos4;
tContenidos4 = objArray.IniGetSection(cadena2, "password");
if (tContenidos4.Length > 0)
{
int i;
for (i = 0; i < tContenidos4.Length; i += 2)
{
pass = tContenidos4[i];
}
}
//MessageBox.Show("Lanzando alerta");
Thread tarea = new Thread(new ThreadStart(LanzaCorreos));
tarea.Start();
cls_Control objControl = new cls_Control(DateTime.Today, 1, 1);
objControlDAO.Insertar(objControl);
}
else
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment