using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

/// <summary>
/// Summary description for Notifications
/// </summary>
public class Notifications
{
	public Notifications()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    static public string successMessage = "success";
    static public string errorMessage = "error";
    static public string infoMessage = "info";
    static public string warningMessage = "warning";

    public static void showMessage(string message, System.Web.UI.Page o, string type, bool hideModal)
    {
        if(hideModal)
            ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>toastr." + type + "('" + message + "');$('#modal-xl').modal('hide');</script>", false);
        else
            ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>toastr." + type + "('" + message + "');</script>", false);
    }

    public static void showModal(string modalName, System.Web.UI.Page o)
    {

        ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>$('#" + modalName + "').modal('show');</script>", false);
    }

    public static void hideModal(string modalName, System.Web.UI.Page o)
    {

        //ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>$('#" + modalName + "').modal('hide');$('body').removeClass('modal-open');$('.modal-backdrop').remove();</script>", false);
        ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>$('#" + modalName + "').modal('hide');</script>", false);
    }
    public static void hideModal1(string modalName, System.Web.UI.Page o)
    {

        //ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>$('#" + modalName + "').modal('hide');$('body').removeClass('modal-open');$('.modal-backdrop').remove();</script>", false);
        ScriptManager.RegisterStartupScript(o.Page, o.GetType(), "tmp", "<script type='text/javascript'>toastr.error('adsf');$('#" + modalName + "').modal('hide');</script>", false);
    }
}