Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id_usuario = Convert.ToString(Session["id_usuario"]);

            if (id_usuario == null || id_usuario == "")
            {
                Response.Redirect("default.aspx");
            }
            else
            {
                switch (Convert.ToString(Session["rol"]))
                {
                case "SuperAdministrador":
                    usuarios.Visible = true;
                    break;

                case "Administrador":
                    usuarios.Visible = true;
                    break;

                case "Aprendiz":
                    usuarios.Visible = false;
                    break;

                case "Instructor":
                    usuarios.Visible = false;
                    break;

                default:
                    Response.Redirect("default.aspx");
                    break;
                }
                CancelUnexpectedRePost();
                if (!IsPostBack)
                {
                    CADUsuario user  = new CADUsuario();
                    DTOUsuario infor = new DTOUsuario();
                    infor.Id = Convert.ToInt32(id_usuario);
                    user.CargarReportesDeUsuarioAlGV(infor, GVReporte);
                }
            }
            HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
            HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            HttpContext.Current.Response.Cache.SetNoStore();
            // Stop Caching in IE
            Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
            // Stop Caching in Firefox
            Response.Cache.SetNoStore();
            Response.Cache.AppendCacheExtension("no-cache");
            Response.Expires = 0;
            Response.Cache.SetExpires(DateTime.Now);
            Response.Cache.SetValidUntilExpires(true);
        }
Exemple #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            CADUsuario user         = new CADUsuario();
            DTOUsuario infor        = new DTOUsuario();
            int        confirmacion = 0;
            DateTime   fecha_regis  = DateTime.Now;
            string     id_user      = Session["id_usuario"].ToString();
            string     estado       = "Reportado";

            if (NombreProblema.Text != "")
            {
                confirmacion = confirmacion + 1;
            }
            if (Observaciones.Text != "")
            {
                confirmacion = confirmacion + 1;
            }
            if (confirmacion == 2)
            {
                infor.Nomb_report     = NombreProblema.Text;
                infor.Descript_report = Observaciones.Text;
                infor.Fecha_report    = fecha_regis;
                infor.Estado_report   = estado;
                infor.Id = Convert.ToInt32(id_user);
                if (user.InsertarReporteProblema(infor) == 0)
                {
                    user.ObtenerDatosUserEnvioReporte(infor);
                    if (user.EnviarCorreoReporteUser(infor) == true)
                    {
                        user.EnviarCorreoConfirmaciónEnvíoReporteProblema(infor);
                    }
                    infor.Id_u_logueado       = int.Parse(Convert.ToString(Session["id_usuario"]));
                    infor.Descripcion_history = "Registro solicitud ayuda";
                    user.InsertarHistorial(infor);
                    NombreProblema.Text = "";
                    Observaciones.Text  = "";
                    ScriptManager.RegisterClientScriptBlock(this, GetType(), "mensaje", "registro();", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, GetType(), "inconsis", "problema();", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "nopermitecamp", "campos();", true);
            }

            user.CargarReportesDeUsuarioAlGV(infor, GVReporte);
        }