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); } } }
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); } }
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); } }