Пример #1
0
        protected new SortedBindingList <PlanEstudiosInfo> Localize(object value, string column_name)
        {
            SortedBindingList <PlanEstudiosInfo> list = null;
            PlanEstudiosList sourceList = null;

            switch (FilterType)
            {
            case IFilterType.None:
                if (List == null)
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = List;
                break;

            case IFilterType.Filter:
                if (FilteredList == null)
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = FilteredList;
                break;
            }

            FCriteria criteria = null;
            string    related  = "none";

            switch (column_name)
            {
            default:
            {
                criteria = GetCriteria(column_name, value, _operation);
            } break;
            }

            switch (related)
            {
            case "none":
            {
                list = sourceList.GetSortedSubList(criteria);
            } break;
            }

            if (list.Count == 0)
            {
                MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                return(sourceList.GetSortedList());
            }

            DatosSearch.DataSource = list;
            DatosSearch.MoveFirst();

            AddFilterLabel(column_name, value);

            Tabla.Focus();

            return(list);
        }
        public override void RefreshSecondaryData()
        {
            PlanEstudiosList planes = PlanEstudiosList.GetList(false);

            _combo_planes = new Library.Instruction.HComboBoxSourceList(planes);

            Datos_Planes.DataSource = _combo_planes;
            PgMng.Grow(string.Empty, "_combo_planes");

            moleQule.Library.HComboBoxSourceList lista_horas = new moleQule.Library.HComboBoxSourceList();

            lista_horas.Add(new ComboBoxSource(1, "08:00"));
            lista_horas.Add(new ComboBoxSource(2, "09:00"));
            lista_horas.Add(new ComboBoxSource(3, "10:00"));
            lista_horas.Add(new ComboBoxSource(4, "11:00"));
            lista_horas.Add(new ComboBoxSource(5, "12:00"));
            lista_horas.Add(new ComboBoxSource(6, "13:00"));
            lista_horas.Add(new ComboBoxSource(7, "14:00"));
            lista_horas.Add(new ComboBoxSource(8, "15:00"));
            lista_horas.Add(new ComboBoxSource(9, "16:00"));
            lista_horas.Add(new ComboBoxSource(10, "17:00"));
            lista_horas.Add(new ComboBoxSource(11, "18:00"));
            lista_horas.Add(new ComboBoxSource(12, "19:00"));
            lista_horas.Add(new ComboBoxSource(13, "20:00"));
            lista_horas.Add(new ComboBoxSource(14, "21:00"));

            Datos_Horas.DataSource = lista_horas;
            PgMng.Grow(string.Empty, "Datos_Planes.DataSource");

            _promociones         = PromocionList.GetList(false);
            _combo_planes.Childs = new Library.Instruction.HComboBoxSourceList(_promociones);
            PgMng.Grow(string.Empty, "_combo_planes.Childs");
            //PgMng.ShowCronos();
        }
        public override void RefreshSecondaryData()
        {
            moleQule.Library.HComboBoxSourceList lista_horas = new moleQule.Library.HComboBoxSourceList();

            lista_horas.Add(new ComboBoxSource(1, "08:00"));
            lista_horas.Add(new ComboBoxSource(2, "09:00"));
            lista_horas.Add(new ComboBoxSource(3, "10:00"));
            lista_horas.Add(new ComboBoxSource(4, "11:00"));
            lista_horas.Add(new ComboBoxSource(5, "12:00"));
            lista_horas.Add(new ComboBoxSource(6, "13:00"));
            lista_horas.Add(new ComboBoxSource(7, "14:00"));
            lista_horas.Add(new ComboBoxSource(8, "15:00"));
            lista_horas.Add(new ComboBoxSource(9, "16:00"));
            lista_horas.Add(new ComboBoxSource(10, "17:00"));
            lista_horas.Add(new ComboBoxSource(11, "18:00"));
            lista_horas.Add(new ComboBoxSource(12, "19:00"));
            lista_horas.Add(new ComboBoxSource(13, "20:00"));
            lista_horas.Add(new ComboBoxSource(14, "21:00"));

            Datos_Horas.DataSource = lista_horas;

            _planes = PlanEstudiosList.GetList(false);
            moleQule.Library.Instruction.HComboBoxSourceList combo_planes = new moleQule.Library.Instruction.HComboBoxSourceList(_planes);
            Datos_Planes.DataSource = combo_planes;
            PgMng.Grow();

            _planes_extra = PlanExtraList.GetList(false);
            moleQule.Library.Instruction.HComboBoxSourceList combo_planes_extra = new moleQule.Library.Instruction.HComboBoxSourceList(_planes_extra);
            Datos_Extra.DataSource = combo_planes_extra;

            PgMng.Grow();
        }
Пример #4
0
        protected new SortedBindingList <PlanEstudiosInfo> Localize(FilterItem item)
        {
            SortedBindingList <PlanEstudiosInfo> list = null;
            PlanEstudiosList sourceList = null;

            switch (FilterType)
            {
            case IFilterType.None:
                if (List == null)
                {
                    MessageBox.Show(Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = List;
                break;

            case IFilterType.Filter:
                if (FilteredList == null)
                {
                    MessageBox.Show(Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = FilteredList;
                break;

            default:
                sourceList = List;
                break;
            }

            if (item.FilterProperty == IFilterProperty.All)
            {
                FCriteria criteria = GetCriteria(string.Empty, item.Value, null, item.Operation);
                list = sourceList.GetSortedSubList(criteria, _properties_list);
            }
            else
            {
                FCriteria criteria = GetCriteria(item.Column, item.Value, null, item.Operation);
                list = sourceList.GetSortedSubList(criteria, _properties_list);
            }

            if (list.Count == 0)
            {
                MessageBox.Show(Face.Resources.Messages.NO_RESULTS);
                return(sourceList.GetSortedList());
            }

            DatosSearch.DataSource = list;
            DatosSearch.MoveFirst();

            AddFilterLabel(item);

            return(list);
        }
Пример #5
0
        public PlanEstudiosMngForm(bool isModal, Form parent, PlanEstudiosList list)
            : base(isModal, parent, list)
        {
            InitializeComponent();
            SetView(molView.Normal);
            // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas
            DatosLocal_BS    = Datos;
            Tabla.DataSource = DatosLocal_BS;
            SetMainDataGridView(Tabla);
            Datos.DataSource = PlanEstudiosList.NewList().GetSortedList();

            base.SortProperty = Observaciones.DataPropertyName;
            this.Text         = Resources.Labels.PLANES_DOCENTES;
        }
Пример #6
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    PlanEstudiosList listA = PlanEstudiosList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    PlanEstudiosList listD = PlanEstudiosList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            _entity = null;
            RefreshSources();
        }
Пример #7
0
        /// <summary>
        /// Toma la lista de bancos de la base de datos y rellena la tabla.
        /// </summary>
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "PlanEstudios");

            _selected_oid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = PlanEstudiosList.GetList(false);
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Productos");
        }
Пример #8
0
        public override void RefreshSecondaryData()
        {
            base.RefreshSecondaryData();

            _planes = PlanEstudiosList.GetList(false);
            PgMng.Grow(string.Empty, "Planes de Estudio");

            _combo_planes = new Library.Instruction.HComboBoxSourceList(_planes);
            PgMng.Grow(string.Empty, "ComboBox Planes de Estudio");

            _promociones = PromocionList.GetList(false);
            PgMng.Grow(string.Empty, "Promociones");

            _combo_planes.Childs = new Library.Instruction.HComboBoxSourceList(_promociones);
            PgMng.Grow(string.Empty, "ComboBox de Promociones");

            Datos_Planes.DataSource = _combo_planes;
            PgMng.Grow(string.Empty, "Datos_Planes");

            _no_asignables = new List <SesionNoAsignable>();
            PgMng.Grow();
        }
        protected override bool DoSearch()
        {
            bool             plan    = false;
            PlanEstudiosList sublist = null;

            if (_lista == null)
            {
                MessageBox.Show(Resources.Messages.NO_RESULTS);
                return(false);
            }

            FCriteria criteria = null;

            foreach (Control ctl in this.Campos_Groupbox.Controls)
            {
                if (((System.Windows.Forms.RadioButton)ctl).Checked)
                {
                    switch (ctl.Name)
                    {
                    case "Nombre_RB":
                    {
                        criteria = new FCriteria <string>("Nombre", Valor_TB.Text);
                        break;
                    }

                    case "Plan_RB":
                    {
                        CriteriaEx criteriaex = PlanEstudios.GetCriteria(PlanEstudios.OpenSession());
                        criteriaex.AddContains("Nombre", Valor_TB.Text);
                        sublist = PlanEstudiosList.GetList(criteriaex);
                        // No existe el plan
                        if (sublist.Count == 0)
                        {
                            MessageBox.Show(Resources.Messages.NO_RESULTS);
                            return(false);
                        }
                        plan = true;
                        break;
                    }
                    }
                }
            }

            // Consulta en la bd
            SortedBindingList <PromocionInfo> lista;

            if (SortProperty != string.Empty)
            {
                if (!plan)
                {
                    lista = _lista.GetSortedSubList(criteria, SortProperty, SortDirection);
                }
                else
                {
                    PromocionList list = PromocionList.GetList(PromocionList.GetFilteredList(_lista, sublist, "OidPlan"));
                    lista = list.ToSortedList(SortProperty, SortDirection);
                }
            }
            else
            {
                lista = _lista.GetSortedSubList(criteria, "Oid", SortDirection);
            }

            Datos.DataSource = lista;

            if (lista.Count == 0)
            {
                MessageBox.Show(Resources.Messages.NO_RESULTS);
                return(false);
            }

            Datos.MoveFirst();

            return(true);
        }
        protected override bool DoSearch()
        {
            bool             promo        = false;
            bool             plan         = false;
            PromocionList    sublist      = null;
            PlanEstudiosList sublist_plan = null;

            DateTime inicio = DateTime.MinValue;
            DateTime fin    = DateTime.MaxValue;

            if (Desde_DTP.Checked)
            {
                inicio = Desde_DTP.Value;
            }

            if (Hasta_DTP.Checked)
            {
                fin = Hasta_DTP.Value;
            }

            if (_lista == null)
            {
                MessageBox.Show(Resources.Messages.NO_RESULTS);
                return(false);
            }

            FCriteria criteria = null;

            if (Valor_TB.Text != " ")
            {
                foreach (Control ctl in this.Campos_Groupbox.Controls)
                {
                    if (((System.Windows.Forms.RadioButton)ctl).Checked)
                    {
                        switch (ctl.Name)
                        {
                        case "Promocion_RB":
                        {
                            CriteriaEx criteriaex = Promocion.GetCriteria(Promocion.OpenSession());
                            criteriaex.AddContains("Nombre", Valor_TB.Text);
                            criteriaex.Childs = false;
                            sublist           = PromocionList.GetList(criteriaex);
                            // No existe la promoción
                            if (sublist.Count == 0)
                            {
                                MessageBox.Show(Resources.Messages.NO_RESULTS);
                                return(false);
                            }
                            promo = true;
                            break;
                        }

                        case "Plan_RB":
                        {
                            CriteriaEx criteriaex = PlanEstudios.GetCriteria(PlanEstudios.OpenSession());
                            criteriaex.AddContains("Nombre", Valor_TB.Text);
                            criteriaex.Childs = false;
                            sublist_plan      = PlanEstudiosList.GetList(criteriaex);
                            // No existe la promoción
                            if (sublist_plan.Count == 0)
                            {
                                MessageBox.Show(Resources.Messages.NO_RESULTS);
                                return(false);
                            }
                            plan = true;
                            break;
                        }
                        }
                    }
                }
            }

            // Consulta en la bd
            SortedBindingList <HorarioInfo> lista = null;

            if (SortProperty != string.Empty)
            {
                if (promo)
                {
                    HorarioList list = HorarioList.GetList(HorarioList.GetFilteredList(HorarioList.GetFilteredFechaList(_lista, inicio, fin),
                                                                                       sublist, "OidPromocion"));
                    lista = list.ToSortedList(SortProperty, SortDirection);
                }
                else
                {
                    if (plan)
                    {
                        HorarioList list = HorarioList.GetList(HorarioList.GetFilteredList(HorarioList.GetFilteredFechaList(_lista, inicio, fin),
                                                                                           sublist_plan, "OidPlan"));
                        lista = list.ToSortedList(SortProperty, SortDirection);
                    }
                    else
                    {
                        lista = HorarioList.SortList(HorarioList.GetFilteredFechaList(_lista, inicio, fin), SortProperty, SortDirection);
                    };
                }
            }
            else
            {
                lista = _lista.GetSortedSubList(criteria, "Oid", SortDirection);
            }

            Datos.DataSource = lista;

            if (lista.Count == 0)
            {
                MessageBox.Show(Resources.Messages.NO_RESULTS);
                return(false);
            }

            Datos.MoveFirst();

            return(true);
        }