Пример #1
0
        public async Task <IActionResult> OnGetAsync()
        {
            HopeLineUser CurrentUser = await _userManager.GetUserAsync(User);

            if (CurrentUser != null)
            {
                if (CurrentUser.AccountType == DataAccess.Entities.Account.User || CurrentUser.AccountType == DataAccess.Entities.Account.Guest)
                {
                    isUser = true;
                }
                else
                {
                    isUser = false;
                }
            }
            else
            {
                isUser = true;
            }

            Communities = _commonResource.GetCommunities().Select(c => new CommunityViewModel
            {
                Id          = c.Id,
                Name        = c.Name,
                Description = c.Description,
                URL         = c.URL,
                ImageURL    = c.ImageURL
            }).ToList();

            return(Page());
        }
Пример #2
0
 public IActionResult Communities()
 {
     try {
         return(Ok(_commonResource.GetCommunities()));
     } catch (System.Exception ex) {
         _logger.LogInformation("Unable to get Communities: {}", ex);
         return(NotFound());
     }
 }
Пример #3
0
        public async Task <IActionResult> CreateCommunities()
        {
            if (_commonResource.GetCommunities().Count() == 0)
            {
                var communities = new List <CommunityModel> {
                    new CommunityModel {
                        Name        = "Canadian Association for Suicide Prevention",
                        Description = "Referenced is a list of crisis services,centers, and other hotlines that are available 24 hours. General information about these services are available to you and ar elisted in the link referenced. These servies may be more convenient and may provide you with a good alternative. They provide locations of where they are stationed or located if you find that your located somewhere else",
                        URL         = "https://suicideprevention.ca/need-help/",
                        ImageURL    = "https://suicideprevention.ca/resources/Pictures/CASP.png"
                    },
                    new CommunityModel {
                        Name        = "How to deal with suicide on online communities or forums",
                        Description = "Dealing with suicide in online forums can be difficult or challenging.This link can help give you advice in how to dela with these situations online.",
                        URL         = "http://www.managingcommunities.com/2009/06/22/dealing-with-suicide-on-your-online-community-or-forums-how-you-can-help-and-protect-everyone/",
                        ImageURL    = "http://www.managingcommunities.com/wp-content/themes/LagunaBlue/images/logo.jpg"
                    },
                    new CommunityModel {
                        Name        = "We Hear You",
                        Description = "WeHearYou is an alternative website where you can open up and talk to about any issues that are bothering you in life. This website does not require you to sign up as it's optional and when you wish to chat with one of thier agents they will be available. They are open to help clients out in various issues including mental health issues as well.",
                        URL         = "http://myvmlab.senecacollege.ca:6284/app",
                        ImageURL    = "http://myvmlab.senecacollege.ca:6284/assets/images/ocean-wave.jpg"
                    },
                    new CommunityModel {
                        Name        = "The mighty",
                        Description = "Youtube channel dedicated to providing informative videos of both physical and mental illnesses.",
                        URL         = "https://www.youtube.com/channel/UCKQaSdgFK01UyVdv6-Up1mg/videos",
                        ImageURL    = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAkFBMVEW4FBv///+0AACyAAD68vK4ERm2AAvPe3z+/Py3AAD69fXy4OC2AAbv1dbWkpPnxMThsbLcnp+3BRHCTlDLa23GW13jt7e3ChTIY2T36+u5HyO7JSrco6S9Mzbqycm+Oj3AQkTt0tLlvb3eqarXlZbJZ2nEVljRg4T15ubNdHXisrPARkm7Ki++NzrOeHnRgoMESQgGAAAIaUlEQVR4nO2cC3eqvBJAyWBSVNSKD8RnfbVa29P//+9uQjIhaPupYK+WNXutc1ahgNkQJskk1vMIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgigLj/m9i/C7ACzGcO9C/Cbw1mBsXWFFaLPatMX60b0L8ltwCBKAA+vW712SWxKDwytr+/6KjSr0DDkcpkPLe4t1hjs2r9B7yGHFjmlMoULtBczZshdxzqHDojgWbAkcqiQo9qzjK0HuB02fiwHbAK+QX/oIx7EUDeODagShy3rCClaicwPNmi9r6P5NtoPbyINWw/8c60oaQ7T4+Pv1VcaZkS/tdv6cebKuBjXZo+koL1jMZdBpeX9dMV4wlgQsmUGjCV40klvrZVpf+4wtuysZeO5dxLKIRafZaoPosanUmsq4A/4ugajHGj2/7rcC8dcfYtqjCXnYVt0YaDFZQSHZAezYQro+sdaff4YGGVMF50J1ZuJPNoQBm86anYQ1ZvG9i3YbZIdbPqxItoahJ57YP1ldD4cGS6a8Kv3TWL6GdfUa9iIVXsfynxdB7Pt//iVEwk36GjYb8jX0a4kPa/YiYtjPq9Dmp8jXU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DyJnkIFLRic4TEoUi8+m/ZmKHw/8JciSfzmEh1FlvoZMEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARxa/4H2KeX1puYFrcAAAAASUVORK5CYII="
                    },
                    new CommunityModel {
                        Name        = "The Mental Health & Psychosocial Support Network",
                        Description = "A global platform to connect with other people for support and sharing knowledge about mental health.",
                        URL         = "http://www.mhpss.net/",
                        ImageURL    = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQMAAADCCAMAAAB6zFdcAAAA8FBMVEX///8AoNsAn9sAnNoAm9oAodsqodvc8foxqdUXrMUcmdckossTq74Zp8gAmdm/5fUZrszy+/2Gy+sZotEWqd82sdMxrck2s801t8TP7Ph4xukqpt82q+I2sNqZ0+4quci24udexM7s9/xbu+VEs+LZ8POGz9hFvMmd2eDj9Puy3/JsyNLP7PAAoMQAm8dKutqk2PBs0ONSueWLzt51yNgqsMKPz+xRuMcAoLYAo7Ks2OFowOdHssK/5uuD0Ni54fNtvd6NxudexeRqt+Fvyut3vdwAjdFMpdkAkshOstOt1u5JxNtizOBYutEwuc47u+Qxa/0rAAAJ3klEQVR4nO2bDXvaRhLHpV0pEJvIFogaAcG2JAzCJMbKmfSiElrbTXp5OX//b3M7sytpBcRJn+eEcr751W3ICuTZ/87brqhhEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEMTfxI399ad1I6jbjtqIRx8PHOfDB4ez4d0nt25zamD98YNzgDwDLOeuUbdJe8b/+OHgQJNAwPmf/1e+sHQOcgaZCM86naO6Ddsb7h0Xy565wSATYdBsdpZ127Yn3CGDGQ9QBT4YKBEGw6YQ4c+6rdsPHxlOWQCRoDQYDIegQbPTrtu8fQCBoDQYZH+AAlKDZmdRt4HV84k/KzQYREOhwDCNCg2anSdfI4O8FoIEw0jMPknTUNOg2azbxqq5OyhJMIzas1EaSkdQfvDXrG4jqyU+gPQn/kEXCMOZKwiOlstI8BLpdJ64I/xxoGoA+s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+wGMbj8Ti+xNGqNWCZBkbkcO6gx276waYG2F8bGAtslwaRZeuHbxgMooUOTB5pp7OumbVUhqbBOWiQpYAeesVe/EAWKHc2Gsm5NorTDSwR9qP7xi0N4MSMFd+ukg2T8HnRhDK7SBlLeVQpb72lweRcMd+DBqbMiaVRtC7fM+04R9J65W0/QJG42YfDdrexZKiz6BvkltrDrYLrp/L0jcnPlDUoGkO0rPJYyHKiPppn/h/Iid/wA2idbM/zoDGEdyX5KR2MDwfq/NFaGvPpdFODQFYHw5iLv6AGIkVWtWfQ84E2ahV+YD2aE3fmAzfbMhUtJoNNacxle2Vm7bcoQ5HhYsyXNcCEcHl2Bh2DGFtB3ZycnlWjQSz3wbs0kOsbc/BkS9egXdKAbfuBEXvZKbOaLJc5Ep86mOqsDr1A/OZglwZ5j9TDhyuTKvtEfIxkhZujHjxJaudv2HjO5GTPmRr4xGnX/3XWtrnaQokfi/WzA9vU5NkuAh4/YU1435tADzCRTfJqco5zXV2KiU8uZWPkTs/PLys7WQz6SdLfOrWL0yRZSruDtnjDxvPGMElkevfT7NUm7rrvwSkBZ1640O4fLHAXAeNpdn7wrd5K8Hen8/PhxvHO586BGN+7MQRBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARBEARB/AT8Byrk9mntxs+ZAAAAAElFTkSuQmCC"
                    }
                };
                foreach (var item in communities)
                {
                    _commonResource.AddCommunity(item);
                }
                await _commonResource.SaveCommunityAsync();

                return(Ok("Data Newly Populated"));
            }
            return(Ok("Data Already populated"));
        }