Exemple #1
0
        public void cargarDatos()
        {
            String sFilteredUserId = Request.QueryString["q"];

            string[] userParametros = { "@Id_Usuario", sFilteredUserId };
            try
            {
                tabla = ManejadorData.Exec_Stp("spUsuarioData", 's', userParametros);
            }
            catch (Exception)
            {
                throw;
            }

            DateTime BirthDate = DateTime.Parse(tabla.Rows[0]["FechaNacimiento"].ToString());
            var      age       = (DateTime.Now.Year - BirthDate.Year);

            userProfilePicture.ImageUrl = tabla.Rows[0]["Imagen"].ToString();
            txtNombreLabel.Text         = tabla.Rows[0]["Nombre"].ToString() + " " + tabla.Rows[0]["Apellido"].ToString();
            txtEdadLabel.Text           = age.ToString();
            ddlTipoSangreLabel.Text     = tabla.Rows[0]["TipoSangre"].ToString();
            txtEmailLabel.Text          = tabla.Rows[0]["Email"].ToString();
            labelcontacto.Text          = tabla.Rows[0]["Tipo"].ToString();
            labeltelefono.Text          = tabla.Rows[0]["Numero"].ToString();
            ddlProvinciaLabel.Text      = tabla.Rows[0]["Provincia"].ToString();
            ddlMunicipioLabel.Text      = tabla.Rows[0]["Municipio"].ToString();
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string[]  parametros = { };
                DataTable tabla      = ManejadorData.Exec_Stp("spCargarTipoSangre", 's', parametros);
                helper.LLenaDrop(ddlTipoSangre, tabla, "TipoSangre", "Id_TipoSangre");

                tabla = ManejadorData.Exec_Stp("spCargarTipoContacto", 'S', parametros);
                helper.LLenaDrop(ddlTipoContacto, tabla, "Tipo", "Id_TipoContacto");

                tabla = ManejadorData.Exec_Stp("spCargarProvincias", 'S', parametros);
                helper.LLenaDrop(ddlProvincia, tabla, "Provincia", "Id_Provincia");
            }
            /*Manage File Upload*/
            /*The first time the image get's upload*/
            if (Session["ImageUpload"] == null && ImageUpload.HasFile)
            {
                Session["ImageUpload"] = ImageUpload;
                ImageUploadLabel.Text  = ImageUpload.FileName;
            }/*If postback was made, persist the image*/
            else if (Session["ImageUpload"] != null && (!ImageUpload.HasFile))
            {
                ImageUpload           = (FileUpload)Session["ImageUpload"];
                ImageUploadLabel.Text = ImageUpload.FileName;
            }/*If user changes image*/
            else if (ImageUpload.HasFile)
            {
                Session["ImageUpload"] = ImageUpload;
                ImageUploadLabel.Text  = ImageUpload.FileName;
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["q"] == null)
                {
                    Response.Redirect("Default.aspx");
                }
                else if (Session["Id_Usuario"] == null)
                {
                    Response.Redirect("Login.aspx");
                }

                ComentarPorRol(Session["Id_Usuario"].ToString());

                /*Request for the post content to DB*/
                string[] parametros = { "@Id_Publicacion", Request.QueryString["q"].ToString() };
                tabla = ManejadorData.Exec_Stp("spRetornarPublicacionPorId", 's', parametros);
                MaquetarInformacion(tabla);

                /*Request for the post comments to DB*/
                string[] parametros2 = { "@Id_Publicacion", Request.QueryString["q"].ToString() };
                tabla = ManejadorData.Exec_Stp("spRetornarComentariosPublicacion", 's', parametros2);
                postComments.formatComments(tabla);
            }
        }
Exemple #4
0
 protected void btnSaveChanges_Click(object sender, EventArgs e)
 {
     if (!validarControls())
     {
         string[] parametros =
         {
             "@Id_Usuario",       Session["Id_Usuario"].ToString(),
             "@Nombre",           txtNombre.Text,
             "@Apellido",         txtApellido.Text,
             "@Imagen",           "",
             "@Email",            txtEmail.Text,
             "@Contrasena",       txtPassword.Text,
             "@FechaNacimiento",  Session["FechaNacimiento"].ToString(),
             "@NumeroTelefonico", txtTelefono.Text,
             "@Id_TipoContacto",  ddlTipoContacto.SelectedValue,
             "@Id_TipoSangre",    ddlTipoSangre.SelectedValue,
             "@Id_Provincia",     ddlProvincia.SelectedValue,
             "@Id_Municipio",     ddlMunicipio.SelectedValue
         };
         try
         {
             ManejadorData.Exec_Stp("spUpdateDonanteReceptorData", 'm', parametros);
             ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "saveFiledsSweetAlert", "swal('Perfil actualizado', 'Cambios guardados exitosamente', 'success')", true);
         }
         catch (Exception)
         {
             throw;
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Campos faltantes', 'En el fomulario existen campos requeridos que se encuentran vacios', 'error')", true);
     }
 }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Id_Usuario"] == null)
                {
                    Response.Redirect("Login.aspx");
                }

                string[] parametros = { };
                tabla = ManejadorData.Exec_Stp("spCargarTipoSangre", 's', parametros);
                helper.LLenaDrop(ddlTipoSangre, tabla, "TipoSangre", "Id_TipoSangre");

                /*Loading Contact Type*/
                tabla = ManejadorData.Exec_Stp("spCargarTipoContacto", 'S', parametros);
                helper.LLenaDrop(ddlTipoContacto, tabla, "Tipo", "Id_TipoContacto");

                /*Loading Provincia Data*/
                tabla = ManejadorData.Exec_Stp("spCargarProvincias", 'S', parametros);
                helper.LLenaDrop(ddlProvincia, tabla, "Provincia", "Id_Provincia");

                cargarDatos();
                EnableControls(false);
            }
        }
Exemple #6
0
 protected void btnSavePost_Click(object sender, EventArgs e)
 {
     if (ValidarControles())
     {
         if (ValidarRolUsuario())
         {
             string[] parametros =
             {
                 "@Titulo",        txtTitulo.Text,
                 "@Id_TipoSangre", ddlTipoSangre.SelectedValue,
                 "@Contenido",     postEditor.Value,
                 "@Fecha",         DateTime.Now.ToString(),
                 "@Id_Usuario",    Session["Id_Usuario"].ToString()
             };
             try
             {
                 ManejadorData.Exec_Stp("spCrearPublicacion", 'm', parametros);
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Publicación hecha!', 'El post fue publicado exitosamente, todos los donantes han sido notificados','success').then((value) => { window.location.href = '/Default.aspx'; })", true);
             }
             catch (Exception)
             {
                 throw;
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Error!', 'Solo las instituciones pueden crear publicaciones','error')", true);
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Campos faltantes', 'En el fomulario para publicar existen campos vacios','error')", true);
     }
 }
Exemple #7
0
        protected void btningresar_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtemail.Text) && !string.IsNullOrWhiteSpace(txtpassword.Text))
            {
                string[]  parametros = { "@Email", txtemail.Text, "@contrasena", txtpassword.Text };
                DataTable tabla      = ManejadorData.Exec_Stp("spLoginEmail", 's', parametros);

                if (tabla.Rows.Count > 0)
                {
                    //Session["NombreUsuario"] = (tabla.Rows[0]["Nombre"] + " "+ tabla.Rows[0]["Apellido"]);
                    Session["NombreUsuario"] = (tabla.Rows[0]["Nombre"]);
                    Session["Id_Usuario"]    = tabla.Rows[0]["Id_Usuario"].ToString();
                    Session["Id_Rol"]        = tabla.Rows[0]["Id_Rol"].ToString();
                    Response.Redirect("Default.aspx");
                }
                else
                {
                    //pnlError.Visible = true;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "invalidLogin", "swal('Acceso invalido', 'Tu usuario o contraseña es incorrecto', 'error')", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsLogin", "swal('Acceso invalido', 'Los campos para iniciar sesión están vacios', 'error')", true);
            }
        }
Exemple #8
0
 protected void btnGuardarComentario_Click(object sender, EventArgs e)
 {
     if (txtComentario.Value != null)
     {
         string[] parametros =
         {
             "@Contenido",      txtComentario.Value,
             "@Fecha",          DateTime.Now.ToString(),
             "@Id_Usuario",     Session["Id_Usuario"].ToString(),
             "@Id_Publicacion", Request.QueryString["q"].ToString()
         };
         try
         {
             ManejadorData.Exec_Stp("spCrearComentario", 'm', parametros);
             Response.Redirect("Publicacion.aspx?q=" + Request.QueryString["q"].ToString());
             //ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Comentario agregado!', '','success').then((value) => { window.location.reload() })", true);
         }
         catch (Exception)
         {
             throw;
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Campo faltante', 'Debes ponerle un texto al comentario o elegir una respuesta rápida','error')", true);
     }
 }
Exemple #9
0
        private bool ValidarRolUsuario()
        {
            string[]  parametros = { "@Nombre", "Institucion" };
            DataTable tabla      = ManejadorData.Exec_Stp("spObtenerRolPorNombre", 's', parametros);

            if (Session["Id_Rol"].ToString() == tabla.Rows[0]["Id_Rol"].ToString())
            {
                return(true);
            }
            return(false);
        }
Exemple #10
0
        protected void showCreatePostButton(string currentUserRolId)
        {
            string[]  parametros = { "@Nombre", "Institucion" };
            DataTable tabla      = ManejadorData.Exec_Stp("spRetonarRolId", 's', parametros);
            Int32     donanteId  = Convert.ToInt32(tabla.Rows[0]["Id_Rol"].ToString());

            if (Convert.ToInt32(currentUserRolId) == donanteId)
            {
                btnCrearPost.Style.Remove("display");
            }
        }
Exemple #11
0
        private bool validateEmailExistence()
        {
            string[]  emailValidation     = { "@Email", txtEmail.Text };
            DataTable respuestaValidacion = ManejadorData.Exec_Stp("spValidateEmail", 's', emailValidation);

            if (Convert.ToInt32(respuestaValidacion.Rows[0].ItemArray[0]) != 0)
            {
                return(false);
            }
            return(true);
        }
Exemple #12
0
        private bool validateRNCExistence()
        {
            string[]  rncValidation       = { "@Rnc", txtRNC.Text };
            DataTable respuestaValidacion = ManejadorData.Exec_Stp("spValidateRNC", 's', rncValidation);

            if (Convert.ToInt32(respuestaValidacion.Rows[0].ItemArray[0]) != 0)
            {
                return(false);
            }
            return(true);
        }
Exemple #13
0
        protected void ddlProvincia_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList drop = (DropDownList)sender;

            ddlMunicipio.ClearSelection();
            if (drop.SelectedValue.ToString() != "")
            {
                string[] parametros = { "@idProvincia", drop.SelectedValue.ToString() };
                tabla = ManejadorData.Exec_Stp("spCargarMunicipio", 'S', parametros);
                helper.LLenaDrop(ddlMunicipio, tabla, "Municipio", "Id_Municipio");
            }
        }
Exemple #14
0
 protected void btnEliminarPublicacion_Click(object sender, EventArgs e)
 {
     string[] parametros = { "@Id_Publicacion", Request.QueryString["q"].ToString() };
     try
     {
         ManejadorData.Exec_Stp("spEliminarPublicacion", 'm', parametros);
         Response.Redirect("Default");
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #15
0
        private void ComentarPorRol(string currentUserId)
        {
            string[] parametros = { "@Nombre", "Donante" };
            tabla = ManejadorData.Exec_Stp("spRetonarRolId", 's', parametros);
            Int32 donanteId = Convert.ToInt32(tabla.Rows[0]["Id_Rol"].ToString());

            if (Convert.ToInt32(currentUserId) == donanteId)
            {
                noAbleToCommentDiv.Style.Add("display", "none");
            }
            else
            {
                ableToCommentDiv.Style.Add("display", "none");
            }
        }
Exemple #16
0
        protected void ddlProvincia_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList provinciaDrop = (DropDownList)sender;

            string[] parametros = { "@idProvincia", provinciaDrop.SelectedValue.ToString() };
            if (provinciaDrop.SelectedValue.ToString() != "")
            {
                DataTable table = ManejadorData.Exec_Stp("spCargarMunicipio", 's', parametros);
                helper.LLenaDrop(MunicipioDropDown, table, "Municipio", "Id_Municipio");
            }
            else
            {
                MunicipioDropDown.Items.Clear();
            }
        }
Exemple #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["Id_Usuario"] != null)
         {
             string[] parametros = { };
             /*Request for all blood type*/
             DataTable tabla = ManejadorData.Exec_Stp("spCargarTipoSangre", 's', parametros);
             helper.LLenaDrop(ddlTipoSangre, tabla, "TipoSangre", "Id_TipoSangre");
         }
         else
         {
             Response.Redirect("Login.aspx");
         }
     }
 }
Exemple #18
0
 protected void btnMensajeRapido1_Click(object sender, EventArgs e)
 {
     string[] parametros =
     {
         "@Contenido",      btnMensajeRapido1.Text,
         "@Fecha",          DateTime.Now.ToString(),
         "@Id_Usuario",     Session["Id_Usuario"].ToString(),
         "@Id_Publicacion", Request.QueryString["q"].ToString()
     };
     try
     {
         ManejadorData.Exec_Stp("spCrearComentario", 'm', parametros);
         Response.Redirect("Publicacion.aspx?q=" + Request.QueryString["q"].ToString());
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #19
0
 protected void btnMensajeRapido2_Click(object sender, EventArgs e)
 {
     string[] parametros =
     {
         "@Contenido",      btnMensajeRapido2.Text,
         "@Fecha",          DateTime.Now.ToString(),
         "@Id_Usuario",     Session["Id_Usuario"].ToString(),
         "@Id_Publicacion", Request.QueryString["q"].ToString()
     };
     try
     {
         ManejadorData.Exec_Stp("spCrearComentario", 'm', parametros);
         Response.Redirect("Publicacion.aspx?q=" + Request.QueryString["q"].ToString());
         //ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Comentario agregado!', '','success').then((value) => { location.reload() })", true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Id_Rol"] != null)
                {
                    showCreatePostButton(Session["Id_Rol"].ToString());
                }
                string[]  parametros = { };
                DataTable table      = ManejadorData.Exec_Stp("spCargarProvincias", 's', parametros);
                helper.LLenaDrop(ProvinciaDropDown, table, "Provincia", "Id_Provincia");
                helper.LLenaDrop(PostProvinciaDropDown, table, "Provincia", "Id_Provincia");

                table = ManejadorData.Exec_Stp("spCargarTipoSangre", 's', parametros);
                helper.LLenaDrop(TipoSangreDropDown, table, "TipoSangre", "Id_TipoSangre");
                helper.LLenaDrop(PostTipoSangreDropDown, table, "TipoSangre", "Id_TipoSangre");

                /*Send post to web api*/
                table = ManejadorData.Exec_Stp("spRetornarPublicaciones", 's', parametros);
                postController.formatPosts(table);
            }
        }
Exemple #21
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            string idUsuario = Session["Id_Usuario"].ToString();

            string[] parametros = { "@Id_Usuario", idUsuario };
            try
            {
                ManejadorData.Exec_Stp("spEliminarCuentaUsuario", 'm', parametros);

                /*Log-out from WebSite*/
                Session["NombreUsuario"] = null;
                Session["Id_Usuario"]    = null;
                Session["Id_Rol"]        = null;
                /*Used in Perfil.aspx*/
                Session["currentUser"] = null;
                Response.Redirect("Default.aspx");
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #22
0
        public void cargarDatos()
        {
            string idUsuario = Session["Id_Usuario"].ToString();

            string[] userParametros = { "@Id_Usuario", idUsuario };
            tabla = ManejadorData.Exec_Stp("spUsuarioData", 's', userParametros);

            if (Session["Id_Rol"].ToString() == "1")
            {
                txtApellido.Text            = tabla.Rows[0]["Apellido"].ToString();
                txtFechaNacimiento.Text     = helper.dateFormat(tabla.Rows[0]["FechaNacimiento"].ToString(), "dd-MM-yyyy");
                ddlTipoSangre.SelectedValue = tabla.Rows[0]["FechaNacimiento"].ToString();
                Session["FechaNacimiento"]  = tabla.Rows[0]["FechaNacimiento"].ToString();
                ddlTipoSangre.SelectedValue = tabla.Rows[0]["Id_TipoSangre"].ToString();
                CtrlRNC.Visible             = false;
                titulo.Text = "Datos Personales";
            }
            else if (Session["Id_Rol"].ToString() == "2")
            {
                btnModificar.Visible = false;
                CtrlApellido.Visible = false;
                CtrlFecha.Visible    = false;
                CtrlSangre.Visible   = false;
                txtRNC.Text          = tabla.Rows[0]["RNC"].ToString();
                titulo.Text          = "Datos Institucionales";
            }

            txtNombre.Text = tabla.Rows[0]["Nombre"].ToString();
            txtEmail.Text  = tabla.Rows[0]["Email"].ToString();
            ddlTipoContacto.SelectedValue = tabla.Rows[0]["Id_TipoContacto"].ToString();
            txtTelefono.Text           = tabla.Rows[0]["Numero"].ToString();
            ddlProvincia.SelectedValue = tabla.Rows[0]["Id_Provincia"].ToString();
            string[]  parametros = { "@idProvincia", tabla.Rows[0]["Id_Provincia"].ToString() };
            DataTable tablita    = ManejadorData.Exec_Stp("spCargarMunicipio", 'S', parametros);

            helper.LLenaDrop(ddlMunicipio, tablita, "Municipio", "Id_Municipio");
            ddlMunicipio.SelectedValue = tabla.Rows[0]["Id_Municipio"].ToString();
        }
Exemple #23
0
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            FilteredUsersController ajaxFilteredUseres = new FilteredUsersController();
            String indexProvincia  = ProvinciaDropDown.SelectedValue;
            String indexMunicipio  = MunicipioDropDown.SelectedValue;
            String indexTipoSangre = TipoSangreDropDown.SelectedValue;

            if (indexProvincia != string.Empty &&
                indexMunicipio != string.Empty &&
                indexTipoSangre == string.Empty)
            {
                //Filtrado por direccion
                string[] parametros =
                {
                    "@Id_Provincia", indexProvincia,
                    "@Id_Municipio", indexMunicipio
                };
                try
                {
                    filteredUsers = ManejadorData.Exec_Stp("spFiltradoPorDireccion", 's', parametros);
                    ajaxFilteredUseres.formatUsers(filteredUsers);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else if (indexProvincia == string.Empty &&
                     indexMunicipio == string.Empty &&
                     indexTipoSangre != string.Empty)
            {
                //Filtrado por tipo de sangre
                string[] parametros = { "@Id_TipoSangre", indexTipoSangre };
                try
                {
                    filteredUsers = ManejadorData.Exec_Stp("spFiltradoPorSangre", 's', parametros);
                    ajaxFilteredUseres.formatUsers(filteredUsers);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else if (indexProvincia != string.Empty &&
                     indexMunicipio != string.Empty &&
                     indexTipoSangre != string.Empty)
            {
                //Filtrado por direccion y tipo de sangre
                string[] parametros =
                {
                    "@Id_Provincia",  indexProvincia,
                    "@Id_Municipio",  indexMunicipio,
                    "@Id_TipoSangre", indexTipoSangre
                };
                try
                {
                    filteredUsers = ManejadorData.Exec_Stp("spFiltradoPorDireccionYSangre", 's', parametros);
                    ajaxFilteredUseres.formatUsers(filteredUsers);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else if (indexProvincia == string.Empty &&
                     indexMunicipio == string.Empty &&
                     indexTipoSangre == string.Empty)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "unvalidFilteredAction", "swal('Busqueda invalida', 'Debes seleccionar un tipo de sangre o dirección o ambos a la vez para poder filtrar', 'error')", true);
            }
        }
Exemple #24
0
 protected void btnRegistrarse_Click(object sender, EventArgs e)
 {
     if (ValidarControles())
     {
         if (hdnOpcion.Value == "ind")
         {
             if (validateEmailExistence())
             {
                 String url = SaveImage(this.ImageUpload);
                 if (url != "Imagen grande")
                 {
                     string[] parametros =
                     {
                         "@Nombre",           txtNombre.Text,
                         "@Apellido",         txtApellido.Text,
                         "@Imagen",           url,
                         "@Email",            txtEmail.Text,
                         "@Contrasena",       txtContrasena.Text,
                         "@FechaNacimiento",  helper.dateFormat(txtFechaNacimiento.Text,"yyyy-dd-MM"),
                         "@Id_TipoSangre",    ddlTipoSangre.SelectedValue,
                         "@NumeroTelefonico", txtTelefono.Text,
                         "@Id_TipoContacto",  ddlTipoContacto.SelectedValue,
                         "@Id_Provincia",     ddlProvincia.SelectedValue,
                         "@Id_Municipio",     ddlMunicipio.SelectedValue
                     };
                     try
                     {
                         ManejadorData.Exec_Stp("spRegistrarDonanteReceptor", 'm', parametros);
                         // Validacion que eliminar imagen de session luego de registrar
                         Session["ImageUpload"] = null;
                         ScriptManager.RegisterStartupScript(this, this.GetType(), "saveFiledsSweetAlert", "swal('Registro hecho', 'Bienvenido, tu registro fue hecho exitosamente', 'success').then((value) => { window.location.href = '/Login.aspx'; })", true);
                     }
                     catch (Exception)
                     {
                         throw;
                     }
                 }
                 else
                 {
                     ScriptManager.RegisterStartupScript(this, this.GetType(), "imageTooBig", "swal('Error con imagen', 'La imagen es muy grande (debe ser igual o menor de 6 MB)', 'error')", true);
                 }
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "emailAlreadyInUse", "swal('Error: Email ya existe', 'El correo electronico o email que fue ingresado está siendo utilizado por otro usuario', 'error')", true);
             }
         }
         else if (hdnOpcion.Value == "ins")
         {
             if (validateRNCExistence())
             {
                 String url = SaveImage(this.ImageUpload);
                 if (url != "Imagen grande")
                 {
                     string[] parametros =
                     {
                         "@RNC",              txtRNC.Text,
                         "@Nombre",           txtNombre.Text,
                         "@Imagen",           url,
                         "@Email",            txtEmail.Text,
                         "@Contrasena",       txtContrasena.Text,
                         "@NumeroTelefonico", txtTelefono.Text,
                         "@Id_TipoContacto",  ddlTipoContacto.SelectedValue,
                         "@Id_Provincia",     ddlProvincia.SelectedValue,
                         "@Id_Municipio",     ddlMunicipio.SelectedValue
                     };
                     try
                     {
                         ManejadorData.Exec_Stp("spRegistrarInstitucion", 'm', parametros);
                         // Validacion que eliminar imagen de session luego de registrar
                         Session["ImageUpload"] = null;
                         ScriptManager.RegisterStartupScript(this, this.GetType(), "saveFiledsSweetAlert", "swal('Registro exitoso', 'Bienvenido, tu registro fue hecho exitosamente', 'success').then((value) => { window.location.href = '/Login.aspx'; })", true);
                     }
                     catch (Exception)
                     {
                         throw;
                     }
                 }
                 else
                 {
                     ScriptManager.RegisterStartupScript(this, this.GetType(), "imageTooBig", "swal('Error con imagen','La imagen es muy grande (debe ser igual o menor de 6 MB)', 'error')", true);
                 }
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "rncAlreadyInUse", "swal('Error: RNC ya existe', 'El RNC que fue ingresado está siendo utilizado por otro usuario', 'error')", true);
             }
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "emptyFieldsSweetAlert", "swal('Campos faltantes', 'En el fomulario existen campos vacios','error')", true);
     }
 }