protected void Page_Load(object sender, EventArgs e) { string strScript = ""; bool blnDebugSession = false; Departamento objDepartamento = new Departamento(); Rol objRol = new Rol(); Usuario objUsuario = new Usuario(); try { if (!this.IsPostBack) { this.ddlDepartamento.DataSource = objDepartamento.ObtenerCatalogo(); this.ddlDepartamento.DataTextField = "Descripcion"; this.ddlDepartamento.DataValueField = "idDepartamento"; this.ddlDepartamento.DataBind(); this.ddlDepartamento.Items.Insert(0, ""); this.ddlRol.DataSource = objRol.ObtenerCatalogo(); this.ddlRol.DataTextField = "Descripcion"; this.ddlRol.DataValueField = "idRol"; this.ddlRol.DataBind(); this.ddlRol.Items.Insert(0, ""); this.ddlUser.DataSource = objUsuario.ObtenerCatalogo(); this.ddlUser.DataTextField = "vNombre"; this.ddlUser.DataValueField = "idUsuario"; this.ddlUser.DataBind(); this.ddlUser.Items.Insert(0, ""); } //Verifico el lenguaje if (UICulture.ToString().ToUpper().IndexOf(ConfigurationManager.AppSettings["CaracterUICultura"].ToString()) > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } // Veo variables de session: blnDebugSession = Convert.ToBoolean(ConfigurationManager.AppSettings["SessionDebug"]); if (blnDebugSession) { Session["userIDInj"] = "1"; Session["usernameInj"] = "Admin"; } } catch (Exception ex) { strScript = "Error: " + ex.Message.ToString().Replace("'", "").Replace("\n", "\\n").Replace("\r", "\\n").Replace(Convert.ToString((char)10), "\\n").Replace(Convert.ToString((char)13), "\\n"); } finally { if (strScript != "") { strScript = "<script language='javascript'> alert('" + strScript + "');</script>"; System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false); } } }
// Module defining this command // Optional custom code for this activity /// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (Module.Expression != null) { targetCommand.AddParameter("Module", Module.Get(context)); } if (FullyQualifiedModule.Expression != null) { targetCommand.AddParameter("FullyQualifiedModule", FullyQualifiedModule.Get(context)); } if (SourcePath.Expression != null) { targetCommand.AddParameter("SourcePath", SourcePath.Get(context)); } if (LiteralPath.Expression != null) { targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context)); } if (Recurse.Expression != null) { targetCommand.AddParameter("Recurse", Recurse.Get(context)); } if (UICulture.Expression != null) { targetCommand.AddParameter("UICulture", UICulture.Get(context)); } if (Credential.Expression != null) { targetCommand.AddParameter("Credential", Credential.Get(context)); } if (UseDefaultCredentials.Expression != null) { targetCommand.AddParameter("UseDefaultCredentials", UseDefaultCredentials.Get(context)); } if (Force.Expression != null) { targetCommand.AddParameter("Force", Force.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }
void m_parsingWorker_DoWork(object sender, DoWorkEventArgs e) { // THREADING DANGER ZONE! UICulture.Initialize(); var worker = (BackgroundWorker)sender; var protocol = m_currentProtocol; int turnOffTimes = 0; while (!worker.CancellationPending) { ViewerItem item = null; lock (m_parsingQueue) { if (m_parsingQueue.Count > 0) { item = m_parsingQueue.Dequeue(); } } if (item == null) { ++turnOffTimes; if (turnOffTimes == 50) { return; } Thread.Sleep(100); continue; } if (item.Viewer != this || item.Log != m_currentLog) { continue; } var parser = item.Parser; if (parser == null) { turnOffTimes = 0; protocol.CreateParser(item); parser = item.Parser; } if (!parser.IsParsed) { turnOffTimes = 0; parser.Parse(); } } }
protected void Page_Load(object sender, EventArgs e) { string strScript = ""; bool blnDebugSession = false; this.txtParametroPuntajeAsignado.Attributes.Add("onKeyPress", "Javascript:return OnlyNumbers(event);"); try { if (this.hidIdParametroGrupoGrowing.Value == "") { this.txtCatalogoNombreEN_NA_OK_X.Enabled = false; this.txtCatalogoNombreES_NA_OK_X.Enabled = false; this.chkCatalogoActivo_NA_OK_X.Enabled = false; this.btnCatalogoSave_NA_OK_X.Enabled = false; this.txtCatalogoNombreEN_S_A_G_N.Enabled = false; this.txtCatalogoNombreES_S_A_G_N.Enabled = false; this.chkCatalogoActivo_S_A_G_N.Enabled = false; this.btnCatalogoSave_S_A_G_N.Enabled = false; } //Verifico el lenguaje // Seteo por default el valor para la variable de session de las imagenes y variables de session: this.Session["UserTemp"] = ""; Session["ImagesUpload"] = null; blnDebugSession = Convert.ToBoolean(ConfigurationManager.AppSettings["SessionDebug"]); if (blnDebugSession) { Session["userIDInj"] = "0"; Session["usernameInj"] = "Admin"; } if (UICulture.ToString().ToUpper().IndexOf("Ñ") > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } } catch (Exception exError) { strScript = "Error al inicializar la pagina:\\n" + exError.ToString(); } if (strScript != "") { strScript = "<script language='javascript'> popUpAlert('" + strScript + "','error');</script>"; System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false); } }
protected void Page_Load(object sender, EventArgs e) { string strScript = ""; bool blnDebugSession = false; try { if (!Page.IsPostBack) { this.txtMinutoInicio.Attributes.Add("onKeyPress", "Javascript:return OnlyNumbers(event);"); this.txtMinutoFin.Attributes.Add("onKeyPress", "Javascript:return OnlyNumbers(event);"); txtColorP.Attributes.Add("readonly", "true"); // Seteo por default el valor para la variable de session de las imagenes y variables de session: this.Session["UserTemp"] = ""; Session["ImagesUpload"] = null; blnDebugSession = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["SessionDebug"]); if (blnDebugSession) { Session["userIDInj"] = "0"; Session["usernameInj"] = "Admin"; } if (UICulture.ToString().ToUpper().IndexOf("Ñ") > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } cargaVariedades(); chkVariedad.Visible = true; } } catch (Exception exError) { strScript = "Error al inicializar la pagina:\\n" + exError.ToString(); } if (strScript != "") { strScript = "<script language='javascript'> popUpAlert('" + strScript + "','error');</script>"; System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false); } }
protected void Page_Load(object sender, EventArgs e) { string strScript = ""; bool blnDebugSession = false; try { // Seteo por default el valor para la variable de session de las imagenes y variables de session: blnDebugSession = Convert.ToBoolean(ConfigurationManager.AppSettings["SessionDebug"]); if (blnDebugSession) { Session["userIDInj"] = "1"; Session["usernameInj"] = "Admin"; } if (UICulture.ToString().ToUpper().IndexOf("Ñ") > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } // Cargo el grid: if (!IsPostBack) { this.dstDiasEntreCortes.DataBind(); this.gvDias.DataBind(); } } catch (Exception exError) { strScript = "Error al inicializar la pagina:\\n" + exError.ToString(); } if (strScript != "") { strScript = "<script language='javascript'> alert('" + strScript + "');</script>"; System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false); } }
protected void Page_Load(object sender, EventArgs e) { string strScript = ""; bool blnDebugSession = false; try { //Verifico el lenguaje // Seteo por default el valor para la variable de session de las imagenes y variables de session: this.Session["UserTemp"] = ""; Session["ImagesUpload"] = null; blnDebugSession = Convert.ToBoolean(ConfigurationManager.AppSettings["SessionDebug"]); if (blnDebugSession) { Session["userIDInj"] = "0"; Session["usernameInj"] = "Admin"; } if (UICulture.ToString().ToUpper().IndexOf("Ñ") > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } } catch (Exception exError) { strScript = "Error al inicializar la pagina:\\n" + exError.ToString(); } if (strScript != "") { strScript = "<script language='javascript'> popUpAlert('" + strScript + "','error');</script>"; System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false); } }
// Module defining this command // Additional custom code for this activity /// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of System.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (UICulture.Expression != null) { targetCommand.AddParameter("UICulture", UICulture.Get(context)); } if (BaseDirectory.Expression != null) { targetCommand.AddParameter("BaseDirectory", BaseDirectory.Get(context)); } //If BaseDirectory is not specified, try to use the workflow base directory. else { throw new ArgumentException(GeneratedActivitiesResources.ImportLocalizedDataWithEmptyEmptyorNullBaseDirectory); } if (FileName.Expression != null) { targetCommand.AddParameter("FileName", FileName.Get(context)); } if (SupportedCommand.Expression != null) { targetCommand.AddParameter("SupportedCommand", SupportedCommand.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }
protected void btnGuardar_Click(object sender, EventArgs e) { // Vuelvo a generar visible el header para el tema del sorting: if (this.gvConfiguracion.Rows.Count > 0) { this.gvConfiguracion.UseAccessibleHeader = true; this.gvConfiguracion.HeaderRow.TableSection = TableRowSection.TableHeader; } ColoresDePalet objColoresDePalet = new ColoresDePalet(); string strScript = ""; bool blnResultado = false; bool blnExito = true; string idVariedades = ""; if (ValidarValores()) { try { if (UICulture.ToString().ToUpper().IndexOf("Ñ") > 0) { this.hidEsEnEspanol.Value = "true"; } else { this.hidEsEnEspanol.Value = "false"; } objColoresDePalet.MinutoInicio = Convert.ToInt32(this.txtMinutoInicio.Text.Trim()); objColoresDePalet.MinutoFin = Convert.ToInt32(this.txtMinutoFin.Text.Trim()); objColoresDePalet.Color = this.txtColorP.Text; objColoresDePalet.Activo = this.chkActivo.Checked; objColoresDePalet.IdUsuario = Convert.ToInt32(Session["userIDInj"]); for (var item = 0; item < chkVariedad.Items.Count; item++) { if (chkVariedad.Items[item].Selected) { idVariedades += chkVariedad.Items[item].Value + "|"; } } idVariedades = idVariedades.Substring(0, idVariedades.Length - 1); objColoresDePalet.idVariedad = idVariedades; if (this.hidEsEnEspanol.Value == "true") { objColoresDePalet.EsEnEspanol = true; if (this.gvConfiguracion.SelectedIndex >= 0) { objColoresDePalet.IdColoresDePalet = Convert.ToInt32(this.gvConfiguracion.SelectedRow.Cells[0].Text); blnResultado = objColoresDePalet.MantenimientoCatalogo(2); } else { blnResultado = objColoresDePalet.MantenimientoCatalogo(1); } if (blnResultado == true) { strScript = "Registro guardado correctamente.\\n"; blnExito = true; } else { strScript = objColoresDePalet.ErrorMessage; blnExito = false; } } else { objColoresDePalet.EsEnEspanol = false; if (this.gvConfiguracion.SelectedIndex >= 0) { objColoresDePalet.IdColoresDePalet = Convert.ToInt32(this.gvConfiguracion.SelectedRow.Cells[0].Text); blnResultado = objColoresDePalet.MantenimientoCatalogo(2); } else { blnResultado = objColoresDePalet.MantenimientoCatalogo(1); } if (blnResultado == true) { strScript = "Record successfully saved.\\n"; blnExito = true; } else { strScript = objColoresDePalet.ErrorMessage; blnExito = false; } } if (blnResultado == true) { this.dstColoresPalet.DataBind(); this.gvConfiguracion.DataBind(); this.chkActivo.Checked = true; this.txtMinutoInicio.Text = ""; this.txtMinutoFin.Text = ""; this.txtColorP.Text = ""; this.gvConfiguracion.SelectedIndex = -1; this.btnActualizar.Visible = false; this.btnCancelar.Visible = false; this.btnGuardar.Visible = true; this.btnLimpiar.Visible = true; for (var ck = 0; ck < chkVariedad.Items.Count; ck++) { chkVariedad.Items[ck].Enabled = true; chkVariedad.Items[ck].Selected = false; } } } catch (Exception exError) { if (this.hidEsEnEspanol.Value == "true") { strScript = "Error al guardar el registro en la clase ColoresDePalet:MantenimientoCatalogo().\\n" + exError.Message; blnExito = false; } else { strScript = "Failed to save the record to the class ColoresDePalet:MantenimientoCatalogo().\\n" + exError.Message; blnExito = false; } } finally { objColoresDePalet = null; } } if (!string.IsNullOrEmpty(strScript)) { if (blnExito == true) { strScript = "<script language='javascript'> popUpAlert('" + strScript + "','ok');</script>"; } else { strScript = "<script language='javascript'> popUpAlert('" + strScript + "','error');</script>"; } System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Error", strScript, false); } }
/// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (NoEncryption.Expression != null) { targetCommand.AddParameter("NoEncryption", NoEncryption.Get(context)); } if (CertificateCACheck.Expression != null) { targetCommand.AddParameter("CertificateCACheck", CertificateCACheck.Get(context)); } if (CertificateCNCheck.Expression != null) { targetCommand.AddParameter("CertificateCNCheck", CertificateCNCheck.Get(context)); } if (CertRevocationCheck.Expression != null) { targetCommand.AddParameter("CertRevocationCheck", CertRevocationCheck.Get(context)); } if (EncodePortInServicePrincipalName.Expression != null) { targetCommand.AddParameter("EncodePortInServicePrincipalName", EncodePortInServicePrincipalName.Get(context)); } if (Encoding.Expression != null) { targetCommand.AddParameter("Encoding", Encoding.Get(context)); } if (HttpPrefix.Expression != null) { targetCommand.AddParameter("HttpPrefix", HttpPrefix.Get(context)); } if (MaxEnvelopeSizeKB.Expression != null) { targetCommand.AddParameter("MaxEnvelopeSizeKB", MaxEnvelopeSizeKB.Get(context)); } if (ProxyAuthentication.Expression != null) { targetCommand.AddParameter("ProxyAuthentication", ProxyAuthentication.Get(context)); } if (ProxyCertificateThumbprint.Expression != null) { targetCommand.AddParameter("ProxyCertificateThumbprint", ProxyCertificateThumbprint.Get(context)); } if (ProxyCredential.Expression != null) { targetCommand.AddParameter("ProxyCredential", ProxyCredential.Get(context)); } if (ProxyType.Expression != null) { targetCommand.AddParameter("ProxyType", ProxyType.Get(context)); } if (UseSsl.Expression != null) { targetCommand.AddParameter("UseSsl", UseSsl.Get(context)); } if (Impersonation.Expression != null) { targetCommand.AddParameter("Impersonation", Impersonation.Get(context)); } if (PacketIntegrity.Expression != null) { targetCommand.AddParameter("PacketIntegrity", PacketIntegrity.Get(context)); } if (PacketPrivacy.Expression != null) { targetCommand.AddParameter("PacketPrivacy", PacketPrivacy.Get(context)); } if (Protocol.Expression != null) { targetCommand.AddParameter("Protocol", Protocol.Get(context)); } if (UICulture.Expression != null) { targetCommand.AddParameter("UICulture", UICulture.Get(context)); } if (Culture.Expression != null) { targetCommand.AddParameter("Culture", Culture.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }