protected void Page_Load(object sender, EventArgs e) { try { Alerta = new List <string>(); _mp = (UsuariosMaster)Page.Master; if (!IsPostBack) { ParametrosGenerales parametros = _serviciosParametros.ObtenerParametrosGenerales(); if (parametros != null) { foreach (ArchivosPermitidos alowedFile in _serviciosParametros.ObtenerArchivosPermitidos()) { ArchivosPermitidos += string.Format("{0}|", alowedFile.Extensiones); } TamañoArchivo = double.Parse(parametros.TamanoDeArchivo); } } } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); Alerta = _lstError; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { int idArbol = Convert.ToInt32(Request.QueryString["IdArbol"]); ArbolAcceso arbol = _servicoArbol.ObtenerArbolAcceso(idArbol); if (arbol != null) { ucVisorConsultainformacion.MuestraEvaluacion = arbol.Evaluacion; ucVisorConsultainformacion.IdArbol = idArbol; } else if (Request.UrlReferrer != null) { Response.Redirect(Request.UrlReferrer.ToString()); } else { Response.Redirect("~/Users/FrmDashboardUser.aspx"); } } } catch (Exception ex) { UsuariosMaster master = (UsuariosMaster)Parent; if (master != null) { master.AlertaSucces(ex.Message); } } }
private void btnAceptar_Click(object sender, EventArgs e) { if (txtPassword.Text != "" && txtUsuario.Text != "") { Usuarios usuario = UsuariosMaster.validarLogin(txtUsuario.Text, txtPassword.Text); if (usuario != null) { Form1.usuario = usuario; this.Close(); } else { MessageBox.Show("Datos Incorrectos", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
protected void btnAddDiaDescanso_OnClick(object sender, EventArgs e) { try { if (txtDate.Text.Trim() == string.Empty || txtDate.Text.Trim() == "__/__/____") { throw new Exception("Ingrese una fecha"); } if (txtDescripcionDia.Text.Trim() == string.Empty) { throw new Exception("Ingrese una descripción"); } if (DateTime.ParseExact(txtDate.Text, "dd/MM/yyyy", null) < DateTime.ParseExact(DateTime.Now.ToShortDateString(), "dd/MM/yyyy", null)) { throw new Exception("La fecha no puede ser anterior al dia actual"); } DiaFeriado newDay = new DiaFeriado { Id = 0, Descripcion = txtDescripcionDia.Text, Fecha = DateTime.ParseExact(txtDate.Text, "dd/MM/yyyy", null), IdUsuarioAlta = 1 }; //_servicioDias.AgregarDiaFeriado(newDay); //if (newDay.Id != 0) //{ // DiasFeriadosDetalle.Single(s => s.Id == newDay.Id).Descripcion = newDay.Descripcion; // DiasFeriadosDetalle.Single(s => s.Id == newDay.Id).Fecha = newDay.Fecha; // LlenaDias(); //} //LimpiaCapturaDias(); //LlenaCombos(); UsuariosMaster master = (UsuariosMaster)Page.Master; if (master != null) { master.AlertaSucces(); } } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); Alerta = _lstError; } }
protected void Page_Load(object sender, EventArgs e) { try { mp = (UsuariosMaster)Page.Master; Alerta = new List <string>(); if (!IsPostBack) { LlenaCombos(); } } catch (Exception ex) { if (_lstError == null) { _lstError = new List <string>(); } _lstError.Add(ex.Message); Alerta = _lstError; } }
protected void Page_Load(object sender, EventArgs e) { try { _mp = (UsuariosMaster)Page.Master; Alerta = new List <string>(); faq5_1.CssClass = "panel-collapse collapse in"; faq5_2.CssClass = "panel-collapse collapse in"; faq5_3.CssClass = "panel-collapse collapse in"; if (!IsPostBack) { LlenaCombos(); if (Request.Params["IdArbolAccesoConsulta"] != null) { EsAlta = false; IdArbol = int.Parse(Request.Params["IdArbolAccesoConsulta"]); CargaConsulta(); lblMovimiento.Text = "Edicion opción Consulta"; } else { EsAlta = true; lblMovimiento.Text = "Alta opción Consulta"; } } } catch (Exception ex) { if (_lstError == null || !_lstError.Any()) { _lstError = new List <string> { ex.Message }; } Alerta = _lstError; } }