Пример #1
0
        void PWResource(int CityID)
        {
            resetPWPanelVisible();
            //PW  Distress
            var distress = lq.getPWByCityIDCateID(1, CityID, 1, "en").ToList();;

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



            //PW Sexual
            var sexual = lq.getPWByCityIDCateID(1, CityID, 2, "en").ToList();

            if (sexual.Count() > 0)
            {
                PanelSexual.Visible   = true;
                gvpwSexual.DataSource = sexual;
                gvpwSexual.DataBind();
                lblSexualNum.Text = sexual.Count() + "";
            }


            //PW LGBT
            var lgbt = lq.getPWByCityIDCateID(1, CityID, 3, "en").ToList();

            if (lgbt.Count() > 0)
            {
                Panellgbt.Visible   = true;
                gvpwlgbt.DataSource = lgbt;
                gvpwlgbt.DataBind();
                lbllgbtNum.Text = lgbt.Count() + "";
            }


            //Legal
            var legal = lq.getPWByCityIDCateID(1, CityID, 4, "en").ToList();

            if (legal.Count() > 0)
            {
                PanelLegal.Visible   = true;
                gvpwLegal.DataSource = legal;
                gvpwLegal.DataBind();
                lblLegalNum.Text = legal.Count() + "";
            }


            //Shelters
            var shelters = lq.getPWByCityIDCateID(1, CityID, 5, "en").ToList();

            if (shelters.Count() > 0)
            {
                PanelShelters.Visible   = true;
                gvpwShelters.DataSource = shelters;
                gvpwShelters.DataBind();
                lblSheltersNum.Text = shelters.Count() + "";
            }


            //Housing
            var housing = lq.getPWByCityIDCateID(1, CityID, 6, "en").ToList();

            if (housing.Count() > 0)
            {
                PanelHousing.Visible   = true;
                gvpwHousing.DataSource = housing;
                gvpwHousing.DataBind();
                lblHousingNum.Text = housing.Count() + "";
            }


            //Counselling
            var counselling = lq.getPWByCityIDCateID(1, CityID, 7, "en").ToList();

            if (counselling.Count() > 0)
            {
                PanelCounselling.Visible   = true;
                gvpwCounselling.DataSource = counselling;
                gvpwCounselling.DataBind();
                lblCounsellingNum.Text = counselling.Count() + "";
            }


            //Violence
            var violence = lq.getPWByCityIDCateID(1, CityID, 8, "en").ToList();

            if (violence.Count() > 0)
            {
                PanelViolence.Visible   = true;
                gvpwViolence.DataSource = violence;
                gvpwViolence.DataBind();
                lblViolenceNum.Text = violence.Count() + "";
            }


            //Drugs
            var drug = lq.getPWByCityIDCateID(1, CityID, 9, "en").ToList();

            if (drug.Count() > 0)
            {
                PanelDrugs.Visible   = true;
                gvpwDrugs.DataSource = drug;
                gvpwDrugs.DataBind();
                lblDrugsNum.Text = drug.Count() + "";
            }


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