protected void Page_Load(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(Request["user"]))
            {
                Response.Write("Debe estar logueado para poder ingresar a esta funcionalidad.");
                Response.End();
            }
            else
            {
                _errorReporting = ErrorReporting.getInstance;

                if (!String.IsNullOrEmpty(Request["action"]))
                {
                    Response.Expires = -1;
                    Response.ContentType = "text/plain";

                    switch (Request["action"])
                    {
                        case "loadSolicitudes":
                            Response.Write(loadSolicitudes());
                            break;
                        case "saveSolicitud":
                            Response.Write(saveSolicitud().ToString().ToLower());
                            break;
                    }

                    Response.End();
                }
            }
        }
Example #2
0
 private SqlManager()
 {
     //__ApplicationStatus = ConfigurationManager.AppSettings["ApplicationStatus"];
     __ApplicationStatus = "";
     __ErrorReporting = ErrorReporting.getInstance;
     __ErrorReporting.SqlInstance = this;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(Request["user"]))
            {
                Response.Write("Debe estar logueado para poder ingresar a esta funcionalidad.");
                Response.End();
            }
            else
            {
                SqlDataContext sql = new SqlDataContext();
                var empleados = (from em in sql.relaciones
                                 where em.jefe == Convert.ToInt64(Request["user"])
                                 select em).Count();

                if (empleados > 0)
                {
                    Response.Write("Debe ser supervisor para poder ingresar a esta funcionalidad.");
                    Response.End();
                }
                else
                {
                    _errorReporting = ErrorReporting.getInstance;

                    if (!String.IsNullOrEmpty(Request["action"]))
                    {
                        Response.Expires = -1;
                        Response.ContentType = "text/plain";

                        switch (Request["action"])
                        {
                            case "loadInbox":
                                Response.Write(loadInbox());
                                break;
                            case "chageEstado":
                                Response.Write(chageEstado().ToString().ToLower());
                                break;
                        }

                        Response.End();
                    }
                }
            }
        }