private void TxtUsuario_SelectedIndexChanged(object sender, EventArgs e) { string PathXml = crearCarpetaAppdata() + "\\UserInfo.xml"; if (File.Exists(PathXml.Trim())) { XmlDocument xmldoc = new XmlDocument(); XmlNodeList m_nodelist = null; xmldoc.Load(PathXml.Trim()); m_nodelist = xmldoc.SelectNodes("/Logins/User"); foreach (XmlNode Nodo in m_nodelist) { if (Nodo.ChildNodes.Item(0).Value.ToString().Trim() == Encrypt_Decrypt.Encriptar(TxtUsuario.Text.Trim())) { checkRecordar.Checked = true; checkRecordar.Text = "Dejar de recordar mi " + Environment.NewLine + "usuario"; break; } else { checkRecordar.Checked = false; checkRecordar.Text = "Recordar mi usuario"; } } } }
private void dejarRecordarDatosEnEquipo() { try { string PathXml = crearCarpetaAppdata() + "\\UserMailInfo.xml"; if (File.Exists(PathXml.Trim())) { XmlDocument xmldoc = new XmlDocument(); XmlNodeList m_nodelist = null; xmldoc.Load(PathXml.Trim()); m_nodelist = xmldoc.SelectNodes("/Logins/User"); int cont = 0; foreach (XmlNode Nodo in m_nodelist) { if (Nodo.ChildNodes.Item(0).Value.ToString().Trim() == Encrypt_Decrypt.Encriptar(cmbEmisor.Text.Trim())) { XmlNode parentNode = xmldoc.DocumentElement; XmlNode toDelete = parentNode.ChildNodes.Item(cont); parentNode.RemoveChild(toDelete); xmldoc.Save(PathXml); LlenarComboLogins(); break; } cont++; } } } catch { } }
private void ModificarDatos_OpcionesBarra_HistorialClinico(string pNodo, string Valor) { try { string PathXml = crearCarpetaAppdata() + "\\MenuOptions_HistorialClinico.xml"; if (File.Exists(PathXml.Trim())) { XmlDocument xmldoc = new XmlDocument(); XmlNodeList m_nodelist = null; XmlNode xmlRoot, xmlNode; xmldoc.Load(PathXml.Trim()); xmlRoot = xmldoc.SelectSingleNode("/MenuOptions"); m_nodelist = xmldoc.SelectNodes("/MenuOptions/" + pNodo); foreach (XmlNode Nodo in m_nodelist) { Nodo.InnerText = Encrypt_Decrypt.Encriptar(Valor); xmldoc.Save(PathXml); break; } } } catch { } }
private void recordarDatosEnEquipo() { try { if (crearCarpetaAppdata().Trim() != "") { if (TxtUsuario.Text.Trim() != "") { int nodeCount = 0; XmlDocument xmldoc = new XmlDocument(); XmlNode xmlRoot, xmlNode; string PathXml = crearCarpetaAppdata() + "\\UserInfo.xml"; if (!File.Exists(PathXml.Trim())) { xmlRoot = xmldoc.CreateElement("Logins"); nodeCount = 0; } else { xmldoc.Load(PathXml.Trim()); xmlRoot = xmldoc.SelectSingleNode("/Logins"); nodeCount = xmldoc.ChildNodes.Count; } nodeCount++; xmldoc.AppendChild(xmlRoot); xmlNode = xmldoc.CreateElement("User"); // + nodeCount.ToString()); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar(TxtUsuario.Text.Trim()); //Agregamos el nombre del usuario deseado xmldoc.Save(PathXml.Trim()); checkRecordar.Text = "Dejar de recordar mi" + Environment.NewLine + "usuario"; checkRecordar.Checked = true; LlenarComboLogins(); TxtContraseña.Focus(); } else { checkRecordar.Checked = false; checkRecordar.Text = "Recordar mi usuario"; } } else { checkRecordar.Checked = false; checkRecordar.Text = "Recordar mi usuario"; } } catch { MessageBox.Show(this, "Se produjo un error al crear el archivo que contiene la información de los usuarios que desea almacenar en este equipo, por favor intente de nuevo.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void RecordarOpciones_BarraHistorialClinico() { try { if (!File.Exists(crearCarpetaAppdata() + "\\MenuOptions_HistorialClinico.xml")) { int nodeCount = 0; XmlDocument xmldoc = new XmlDocument(); XmlNode xmlRoot, xmlNode; string PathXML = crearCarpetaAppdata() + "\\MenuOptions_HistorialClinico.xml"; if (!File.Exists(PathXML.Trim())) { xmlRoot = xmldoc.CreateElement("MenuOptions"); nodeCount = 0; } else { xmldoc.Load(PathXML.Trim()); xmlRoot = xmldoc.SelectSingleNode("/MenuOptions"); nodeCount = xmldoc.ChildNodes.Count; } nodeCount++; xmldoc.AppendChild(xmlRoot); xmlNode = xmldoc.CreateElement("ShowAtStartup"); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar("0");//Agregamos el valor cero que será el valor por defecto = NoMostrarInicio xmlNode = xmldoc.CreateElement("CloseAfterSelect"); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar("0");//Agregamos el valor cero que será el valor por defecto = NoMostrarInicio xmlNode = xmldoc.CreateElement("ShowAlways"); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar("0");//Agregamos el valor cero que será el valor por defecto = NoMostrarInicio xmldoc.Save(PathXML.Trim()); } } catch { MessageBox.Show(this, "Se produjo un error al crear el archivo que contiene la información de los usuarios que desea almacenar en este equipo, por favor intente de nuevo.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void CreaArchivoTempCorreoEmpresa() { try { string PathXml = crearCarpetaAppdata() + "\\UserMailInfo.xml"; if (!File.Exists(PathXml.Trim())) { if (crearCarpetaAppdata().Trim() != "") { int nodeCount = 0; XmlDocument xmldoc = new XmlDocument(); XmlNode xmlRoot, xmlNode; if (!File.Exists(PathXml.Trim())) { xmlRoot = xmldoc.CreateElement("Logins"); nodeCount = 0; } else { xmldoc.Load(PathXml.Trim()); xmlRoot = xmldoc.SelectSingleNode("/Logins"); nodeCount = xmldoc.ChildNodes.Count; } nodeCount++; xmldoc.AppendChild(xmlRoot); xmlNode = xmldoc.CreateElement("User"); // + nodeCount.ToString()); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar(Program.oCEmpresa.Email.Trim()); //Agregamos el correo de la empresa xmldoc.Save(PathXml.Trim()); } } } catch { MessageBox.Show(this, "Se produjo un error al crear el archivo que contiene la información de los usuarios que desea almacenar en este equipo, por favor intente de nuevo.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void recordarDatosEnEquipo() { try { File.Delete(crearCarpetaAppdata() + "\\EpicrisisTextGuide.xml"); if (crearCarpetaAppdata().Trim() != "") { int nodeCount = 0; XmlDocument xmldoc = new XmlDocument(); XmlNode xmlRoot, xmlNode; string PathXml = crearCarpetaAppdata() + "\\EpicrisisTextGuide.xml"; if (!File.Exists(PathXml.Trim())) { xmlRoot = xmldoc.CreateElement("DetalleEpicrisis"); nodeCount = 0; } else { xmldoc.Load(PathXml.Trim()); xmlRoot = xmldoc.SelectSingleNode("/DetalleEpicrisis"); nodeCount = xmldoc.ChildNodes.Count; } nodeCount++; xmldoc.AppendChild(xmlRoot); xmlNode = xmldoc.CreateElement("Detalle"); // + nodeCount.ToString()); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar(textBox1.Text.Trim()); //Agregamos el nombre del usuario deseado xmldoc.Save(PathXml.Trim()); } } catch { MessageBox.Show(this, "Se produjo un error al crear el archivo que contiene la guía de texto para las epicrisis generadas, por favor intente de nuevo.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void recordarDatosEnEquipo(DateTime pFechaEnvio) { try { File.Delete(crearCarpetaAppdata() + "\\SentEmails.xml"); if (crearCarpetaAppdata().Trim() != "") { int nodeCount = 0; XmlDocument xmldoc = new XmlDocument(); XmlNode xmlRoot, xmlNode; string PathXml = crearCarpetaAppdata() + "\\SentEmails.xml"; if (!File.Exists(PathXml.Trim())) { xmlRoot = xmldoc.CreateElement("SentDate"); nodeCount = 0; } else { xmldoc.Load(PathXml.Trim()); xmlRoot = xmldoc.SelectSingleNode("/SentDate"); nodeCount = xmldoc.ChildNodes.Count; } nodeCount++; xmldoc.AppendChild(xmlRoot); xmlNode = xmldoc.CreateElement("Date"); // + nodeCount.ToString()); xmlRoot.AppendChild(xmlNode); xmlNode.InnerText = Encrypt_Decrypt.Encriptar(pFechaEnvio.ToLongDateString()); //Agregamos el nombre del usuario deseado xmldoc.Save(PathXml.Trim()); } } catch { MessageBox.Show(this, "Se produjo un error al crear el archivo temporal que indica el estado de los correos enviados, si el error persiste contacte a la persona que le da soporte a su empresa.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }