public void Listar(ref Cls_Privilegios_DAL objDAL) { BDServiceClient Obj_BDService = new BDServiceClient(); try { string SSP_Nombre = "sp_Listar_Privilegios"; string SNombreTabla = "Privilegios"; string error = ""; objDAL.dtTabla = Obj_BDService.ListarDatos(SSP_Nombre, SNombreTabla, ref error); if (error == string.Empty && objDAL.dtTabla != null) { objDAL.sError = string.Empty; } else { objDAL.sError = error; } } catch (Exception ex) { objDAL.sError = ex.Message.ToString(); } finally { Obj_BDService.Close(); } }
public void CargarCombos() { Cls_Privilegios_BLL objBLL = new Cls_Privilegios_BLL(); Cls_Privilegios_DAL objDAL = new Cls_Privilegios_DAL(); objBLL.Listar(ref objDAL); if (objDAL.sError == string.Empty) { cmbPrivilegios.DataSource = null; cmbPrivilegios.DataSource = objDAL.dtTabla; cmbPrivilegios.DataTextField = "Descripcion"; cmbPrivilegios.DataValueField = "Id_Privilegio"; cmbPrivilegios.DataBind(); cmbPrivilegios.SelectedIndex = 0; } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowPopup", "alert('Se presento un problema a la hora de cargar el combo de privilegios');", true); } }