Example #1
0
        void ShelterResource(int CithID)
        {
            resetShelterPanelVisible();
            //Shelter  Distress
            var distress = lq.getShelterByCityIDCateID(1, CithID, 1, "en").ToList();;

            //ISingleResult<getPWNameByCityIDCateIDResult> distress = lq.getPWNameByCityIDCateID(0, 0, 1, "en").ToList(); ;
            if (distress.Count() > 0)
            {
                Panel_S_Distress.Visible = true;
                gv_S_Distress.DataSource = distress;
                gv_S_Distress.DataBind();
                lbl_S_DistressNum.Text = distress.Count() + "";
            }



            //Shelter Sexual
            var sexual = lq.getShelterByCityIDCateID(1, CithID, 2, "en").ToList();

            if (sexual.Count() > 0)
            {
                Panel_S_Sexual.Visible = true;
                gv_S_Sexual.DataSource = sexual;
                gv_S_Sexual.DataBind();
                lbl_S_SexualNum.Text = sexual.Count() + "";
            }


            //Shelter LGBT
            var lgbt = lq.getShelterByCityIDCateID(1, CithID, 3, "en").ToList();

            if (lgbt.Count() > 0)
            {
                Panel_S_lgbt.Visible = true;
                gv_S_LGBT.DataSource = lgbt;
                gv_S_LGBT.DataBind();
                lbl_S_LGBT_Num.Text = lgbt.Count() + "";
            }


            //Shelter Legal
            var legal = lq.getShelterByCityIDCateID(1, CithID, 4, "en").ToList();

            if (legal.Count() > 0)
            {
                Panel_S_Legal.Visible = true;
                gv_S_Legal.DataSource = legal;
                gv_S_Legal.DataBind();
                lbl_S_Legal_Num.Text = legal.Count() + "";
            }


            // Shelter Shelters
            var shelters = lq.getShelterByCityIDCateID(1, CithID, 5, "en").ToList();

            if (shelters.Count() > 0)
            {
                Panel_S_Shelters.Visible = true;
                gv_S_Shelters.DataSource = shelters;
                gv_S_Shelters.DataBind();
                lbl_S_Shelters_Num.Text = shelters.Count() + "";
            }


            // Shelter Housing
            var housing = lq.getShelterByCityIDCateID(1, CithID, 6, "en").ToList();

            if (housing.Count() > 0)
            {
                Panel_S_Housing.Visible = true;
                gv_S_Housing.DataSource = housing;
                gv_S_Housing.DataBind();
                lbl_S_Housing_Num.Text = housing.Count() + "";
            }


            //Shelter Counselling
            var counselling = lq.getShelterByCityIDCateID(1, CithID, 7, "en").ToList();

            if (counselling.Count() > 0)
            {
                Panel_S_Counselling.Visible = true;
                gv_S_Counselling.DataSource = counselling;
                gv_S_Counselling.DataBind();
                lbl_S_Counselling_Num.Text = counselling.Count() + "";
            }


            //Shelter Violence
            var violence = lq.getShelterByCityIDCateID(1, CithID, 8, "en").ToList();

            if (violence.Count() > 0)
            {
                Panel_S_Violence.Visible = true;
                gv_S_Violence.DataSource = violence;
                gv_S_Violence.DataBind();
                lbl_S_Violence_Num.Text = violence.Count() + "";
            }


            //Shelter Drugs
            var drug = lq.getShelterByCityIDCateID(1, CithID, 9, "en").ToList();

            if (drug.Count() > 0)
            {
                Panel_S_Drugs.Visible = true;
                gv_S_Drugs.DataSource = drug;
                gv_S_Drugs.DataBind();
                lbl_S_Drugs_Num.Text = drug.Count() + "";
            }


            lblShelterTotalNum.Text = distress.Count() + sexual.Count() + lgbt.Count() + legal.Count()
                                      + shelters.Count() + housing.Count() + counselling.Count() + violence.Count()
                                      + drug.Count() + "";
        }