public async Task <ActionResult> DeleteConfirmedAsync(string Id)
        {
            string error = "";
            ConfiguracionsController controlConfiguracion = new ConfiguracionsController(db);

            var user = await userManager.FindByIdAsync(Id);

            try
            {
                var result = await userManager.DeleteAsync(user);

                if (!result.Succeeded)
                {
                    foreach (var errorA in result.Errors)
                    {
                        error += errorA.Description + "<br>";
                    }
                }
            }
            catch (Exception ex)
            {
                error = controlConfiguracion.SqlErrorHandler(ex);
            }
            HttpContext.Session.SetComplex("error", error);

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            string error = "";
            ConfiguracionsController controlConfiguracion = new ConfiguracionsController(db);

            ApplicationRole Rol = await db.Roles.FindAsync(id);

            try
            {
                var claims = await db.RoleClaims.Where(n => n.RoleId == Rol.Id).ToListAsync();

                db.RoleClaims.RemoveRange(claims);
                await db.SaveChangesAsync();

                db.Roles.Remove(Rol);
                await db.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                error = controlConfiguracion.SqlErrorHandler(ex);
            }
            HttpContext.Session.SetComplex("error", error);

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            var      controlConfiguracion = new ConfiguracionsController(db);
            Pollster encuestador          = await db.Pollster.FindAsync(id);

            try
            {
                db.Pollster.Remove(encuestador);
                await db.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                var error = controlConfiguracion.SqlErrorHandler(ex);
                HttpContext.Session.SetComplex("error", error);
            }

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            string error = "";
            ConfiguracionsController controlConfiguracion = new ConfiguracionsController(db);

            Responsable responsable = await db.Responsable.FindAsync(id);

            try
            {
                db.Responsable.Remove(responsable);
                await db.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                error = controlConfiguracion.SqlErrorHandler(ex);
                HttpContext.Session.SetComplex("error", error);
            }

            return(RedirectToAction("Index2"));
        }