示例#1
0
        public void SetCBMateria()
        {
            PlanLogic   pl     = new PlanLogic();
            List <Plan> planes = new List <Plan>();

            if (MateriaActual != null)
            {
                planes = pl.TraerPorEspecialidad(pl.GetOne(MateriaActual.IDPlan).IDEspecialidad);

                foreach (Plan espe in planes)
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text  = espe.Descripcion;
                    item.Value = espe.ID;

                    cbDescPlan.Items.Add(item);
                }
                string plstr = pl.GetOne(MateriaActual.IDPlan).Descripcion;
                cbDescPlan.SelectedIndex = cbDescPlan.FindStringExact(plstr);
            }
            else
            {
                cbDescPlan.DataSource    = pl.GetAll();
                cbDescPlan.DisplayMember = "Descripcion";
                cbDescPlan.ValueMember   = "ID";
                cbDescPlan.SelectedValue = -1;
            }
        }
示例#2
0
        public void LlenarDropMateria()
        {
            ddlPlanes.Items.Clear();
            PlanLogic pl = new PlanLogic();

            if (this.Entity != null)
            {
                List <Plan> planes = pl.TraerPorEspecialidad(pl.GetOne(Entity.IDPlan).IDEspecialidad);
                foreach (Plan plan in planes)
                {
                    ListItem item = new ListItem();
                    item.Text  = plan.Descripcion;
                    item.Value = Convert.ToString(plan.ID);

                    ddlPlanes.Items.Add(item);
                }
            }
            else
            {
                List <Plan> planes = pl.GetAll();
                foreach (Plan plan in planes)
                {
                    ListItem item = new ListItem();
                    item.Text  = plan.Descripcion;
                    item.Value = Convert.ToString(plan.ID);

                    ddlPlanes.Items.Add(item);
                }
            }
        }
示例#3
0
        private void listplanesfill()
        {
            PlanLogic pllgc = new PlanLogic();

            if (PersonaActual != null)
            {
                cmbPlan.DataSource    = pllgc.TraerPorEspecialidad(pllgc.GetOne(PersonaActual.IDPlan).IDEspecialidad);
                cmbPlan.DisplayMember = "Descripcion";
                cmbPlan.ValueMember   = "ID";
                string plstr = pllgc.GetOne(PersonaActual.IDPlan).Descripcion;
                cmbPlan.SelectedIndex = cmbPlan.FindStringExact(plstr);
            }
            else
            {
                cmbPlan.DataSource    = pllgc.GetAll();
                cmbPlan.DisplayMember = "Descripcion";
                cmbPlan.ValueMember   = "ID";
                cmbPlan.SelectedIndex = -1;
            }
        }