TFS_ANTIGUO/SIGPC/ProyectoSIGPC/ControlUsuario/cuwMensajeAviso.ascx.cs

69 lines
2.5 KiB
C#
Raw Normal View History

using System;
using AyABL;
//Prueba versionamiento 28/02/2012
public partial class _controlesusuario_cuwMensajeAviso : System.Web.UI.UserControl
{
protected void btnAceptar_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
this.imgAviso.ImageUrl = null;
this.divMensaje.Attributes["class"] = null;
this.lblMensajeAviso.Text = "";
mpeModalconfirmacion.Hide();
}
/// <summary>
/// muestra un mensaje visual en la ventana
/// </summary>
/// <param name="mensaje"></param>
/// <param name="tipoError"></param>
public void showMessage(string p_strMensaje, TiposDeMensajes tipoMensaje)
{
switch (tipoMensaje)
{
case TiposDeMensajes.ERROR:
this.imgAviso.ImageUrl = "~/App_Themes/Basico/Imagenes/Avisos/Critical.png";
this.lblTituloAviso.Text = "Error";
this.divMensaje.Attributes["class"] = "custom error";
break;
case TiposDeMensajes.ALERTA:
this.imgAviso.ImageUrl = "~/App_Themes/Basico/Imagenes/Avisos/Warning.png";
this.lblTituloAviso.Text = "Alerta";
this.divMensaje.Attributes["class"] = "custom alerta";
break;
case TiposDeMensajes.INFORMATIVO:
this.imgAviso.ImageUrl = "~/App_Themes/Basico/Imagenes/Avisos/Info.png";
this.lblTituloAviso.Text = "Información";
this.divMensaje.Attributes["class"] = "custom informacion";
break;
}
this.lblMensajeAviso.Text = p_strMensaje;
mpeModalconfirmacion.Show();
UPMensajeAviso.Update();
}
/// <summary>
/// muestra un mensaje de error en la ventana
/// </summary>
/// <param name="p_strMensaje"></param>
/// <param name="page"></param>
/// <param name="e"></param>
public void showError(string p_strMensaje, Exception ex)
{
// si se presento algun error
if (ex != null)
{
AyAEM.ExceptionManagement.Exceptions.AyAException.Publish(ex, p_strMensaje);
this.imgAviso.ImageUrl = "~/App_Themes/Basico/Imagenes/Avisos/Critical.png";
this.lblTituloAviso.Text = "Error";
this.divMensaje.Attributes["class"] = "custom error";
this.lblMensajeAviso.Text = p_strMensaje;
mpeModalconfirmacion.Show();
UPMensajeAviso.Update();
}
}
}