Esempio n. 1
0
 private void loadClientsForUser()
 {
     if (_webUser.isadmin || _webUser.issuperadmin)  // sa can select a client
     {
         m_data.createDropdown("spGetClientDropdown null", cboClient, "== All ==", "");
     }
     else
     {
         m_data.createDropdown("spGetClientDropdown " + _webUser.userid, cboClient);
     }
 }
Esempio n. 2
0
        // from an sql command, build up a dropdown combo
        public static void setDropdown(RepeaterItemEventArgs e, string ctrlName, string fieldName, string sqlCmd, cData oData, string sBlankOptionText = "", string sBlankOptionVal = "")
        {
            // get a handle on the dropdown
            DropDownList cboTarget = (DropDownList)e.Item.FindControl(ctrlName);

            // run the sql command and build up our dropdown list..
            oData.createDropdown(sqlCmd, cboTarget, sBlankOptionText, sBlankOptionVal);

            // now auto-select the value for this dropdown from the db
            string selectedVal = cTools.cStrExt(System.Web.UI.DataBinder.Eval(e.Item.DataItem, fieldName));

            cTools.autoSelectListItem(cboTarget, selectedVal);
        }