Exemplo n.º 1
0
        private void BindComuni1()
        {
            this.cmbscom_res.Items.Clear();
            Classi.ProvinceComuni _ProvCom = new TheSite.Classi.ProvinceComuni();
            S_ControlsCollection  _SColl   = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_Provid = new S_Object();
            s_Provid.ParameterName = "p_provincia_id";
            s_Provid.DbType        = ApplicationDataLayer.DBType.CustomDBType.Integer;
            s_Provid.Direction     = ParameterDirection.Input;
            s_Provid.Index         = 0;
            s_Provid.Value         = cmbsprov_res.SelectedValue;

            _SColl.Add(s_Provid);

            DataSet _MyDs = _ProvCom.GetComune(_SColl).Copy();

            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                this.cmbscom_res.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource(
                    _MyDs.Tables[0], "descrizione", "comune_id", "- Selezionare un Comune -", "-1");
                this.cmbscom_res.DataTextField  = "descrizione";
                this.cmbscom_res.DataValueField = "comune_id";
                this.cmbscom_res.DataBind();
            }
            else
            {
                string s_Messagggio = "- Nessun Comune  -";
                this.cmbscom_res.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, "-1"));
            }
        }
Exemplo n.º 2
0
        private void BindProvince1()
        {
            this.cmbsprov_res.Items.Clear();
            Classi.ProvinceComuni _ProvCom = new TheSite.Classi.ProvinceComuni();
            DataSet _MyDs = _ProvCom.GetData().Copy();

            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                this.cmbsprov_res.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource(
                    _MyDs.Tables[0], "descrizione_breve", "provincia_id", "- Selezionare una Provincia -", "-1");
                this.cmbsprov_res.DataTextField  = "descrizione_breve";
                this.cmbsprov_res.DataValueField = "provincia_id";
                this.cmbsprov_res.DataBind();
            }
        }