public SistemaCollection ListarSistemas(Sistema oe) { blSistema bl = new blSistema(); Transaction transaction = Helper.InitTransaction(); return(bl.ListarSistemas(oe, out transaction)); }
public SistemaCollection ListarSistemasCombo(Sistema oe) { blSistema bl = new blSistema(); Transaction transaction = Helper.InitTransaction(); SistemaCollection ocol = bl.ListarSistemas(oe, out transaction); ocol.Rows.Insert(0, new Sistema() { id = 0, nombre = " [ SELECCIONE ] ", descripcion = "", estado = true, key = "" }); return(ocol); }
public Transaction EditarSistema(Sistema oe) { blSistema bl = new blSistema(); Transaction transaction = Helper.InitTransaction(); bl.EditarSistema(oe, out transaction); if (transaction.type == TypeTransaction.OK) { try { bl = new blSistema(); Transaction transactionLIST = Helper.InitTransaction(); foreach (Sistema sistema in bl.ListarSistemas(new Sistema() { id = oe.id, nombre = "", descripcion = "", key = "", poolname = "", estado = false }, out transactionLIST).Rows) { //transaction.message = transaction.message + "\nEntro al Foreach"; System.Configuration.ExeConfigurationFileMap wcfm = new System.Configuration.ExeConfigurationFileMap { ExeConfigFilename = oe.fileconfig }; //transaction.message = transaction.message + "\nArchivo encontrado"; System.Configuration.Configuration fileconfig = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(wcfm, System.Configuration.ConfigurationUserLevel.None); //transaction.message = transaction.message + "\nInicializa"; fileconfig.AppSettings.Settings.Remove("sistema"); fileconfig.AppSettings.Settings.Remove("key"); //transaction.message = transaction.message + "\nRemove"; fileconfig.AppSettings.Settings.Add("sistema", oe.sistema_encriptado); fileconfig.AppSettings.Settings.Add("key", oe.key_encriptado); //transaction.message = transaction.message + "\nAdd"; fileconfig.Save(System.Configuration.ConfigurationSaveMode.Modified); System.Configuration.ConfigurationManager.RefreshSection("appSettings"); //transaction.message = transaction.message + "\nGuardo"; transaction.message = transaction.message + "\nSe actualizó el archivo de configuración del sistema"; fileconfig = null; } } catch (Exception ex) { transaction.message = transaction.message + "\nNo se pudo actualizar el archivo de configuración: " + ex.Message; } } return(transaction); }