private void MontaChkBoxList() { ClienteDAL ObjClienteDAL = new ClienteDAL(); ChkBoxList.DataSource = ObjClienteDAL.DropDownList(0, Convert.ToInt32(Session["idPerfil"])); ChkBoxList.DataTextField = "RazaoSocial"; ChkBoxList.DataValueField = "ID"; ChkBoxList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ClienteDAL ObjClienteDAL = new ClienteDAL(); ListBoxCliente.DataSource = ObjClienteDAL.DropDownList(Convert.ToInt32(Session["idUsuario"]), Convert.ToInt32(Session["idPerfil"])); ListBoxCliente.DataTextField = "RazaoSocial"; ListBoxCliente.DataValueField = "ID"; ListBoxCliente.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ClienteDAL ObjClienteDAL = new ClienteDAL(); ddlCliente.DataSource = ObjClienteDAL.DropDownList(Convert.ToInt32(Session["idUsuario"]), Convert.ToInt32(Session["idPerfil"])); ddlCliente.DataTextField = "RazaoSocial"; ddlCliente.DataValueField = "ID"; ddlCliente.DataBind(); ddlCliente.Items.Insert(0, new ListItem("<--Selecione-->", string.Empty)); //Texto Inicial do combo } }
/// <summary> /// Usado para gerar um DropDownList /// </summary> /// <returns></returns> public DataTable DropDownList(int idUsuario, int idPerfil) { ClienteDAL ObjClienteDAL = new ClienteDAL(); return(ObjClienteDAL.DropDownList(idUsuario, idPerfil)); }
/// <summary> /// Usado para gerar um DropDownList /// </summary> /// <returns></returns> public DataTable DropDownList(int idUsuario, int idPerfil) { ClienteDAL ObjClienteDAL = new ClienteDAL(); return ObjClienteDAL.DropDownList(idUsuario,idPerfil); }