protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "WorkReport");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                if (moleQule.Common.ModulePrincipal.GetUseActiveYear())
                {
                    List = WorkReportList.GetList(moleQule.Common.ModulePrincipal.GetActiveYear().Year, false);
                }
                else
                {
                    List = WorkReportList.GetList(false);
                }
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de WorkReports");
        }
        protected override void LoadWorkReports(bool reload = false)
        {
            if (_work_reports == null || reload)
            {
                PgMng.Reset(4, 1, Face.Resources.Messages.LOADING_DATA, this);
                try
                {
                    _work_reports            = WorkReportList.GetByExpedientList(_entity.Oid, false);
                    WorkReport_BS.DataSource = _work_reports;

                    PgMng.Grow(string.Empty);

                    _work_reports_works = WorkReportList.GetByExpedientList(_entity.Relations.ToChildsOidList(), false);

                    PgMng.Grow(string.Empty);

                    UpdateWorkReportsTotals();

                    PgMng.Grow(string.Empty);
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
        }
Beispiel #3
0
        public WorkReportSelectForm(Form parent, WorkReportList lista)
            : base(true, parent, lista)
        {
            InitializeComponent();
            _view_mode = molView.Select;

            _action_result = DialogResult.Cancel;
        }
        protected override void GetFormSourceData(object[] parameters)
        {
            moleQule.Store.Structs.ETipoExpediente tipo = (moleQule.Store.Structs.ETipoExpediente)parameters[0];

            _entity = Expedient.New(tipo);
            _entity.BeginEdit();

            _work_reports = WorkReportList.NewList();
        }
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
            case molAction.Copy:
                if (_entity == null)
                {
                    return;
                }
                if (List.GetItem(_entity.Oid) != null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    WorkReportList listA = WorkReportList.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)
                {
                    WorkReportList listD = WorkReportList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
        public override void PrintList()
        {
            PgMng.Reset(2, 1, Face.Resources.Messages.LOADING_DATA, this);

            WorkReportReportMng rptMng = new WorkReportReportMng(AppContext.ActiveSchema, Text, FilterValues);

            ReportClass report = rptMng.GetListReport(WorkReportList.GetList(Datos.DataSource as IList <WorkReportInfo>));

            PgMng.FillUp();

            ShowReport(report);
        }
Beispiel #7
0
        protected override void GetFormSourceData(long oid, object[] parameters)
        {
            _entity = ExpedientInfo.Get(oid, false);
            PgMng.Grow();

            _entity.LoadChilds(typeof(Batch), true, true);
            PgMng.Grow(string.Empty, "Partidas");

            _entity.LoadChilds(typeof(Expense), true, true);
            PgMng.Grow(string.Empty, "Gastos");

            _work_reports = WorkReportList.GetByExpedientList(_entity.Oid, false);
        }
        public WorkReportMngForm(bool isModal, Form parent, WorkReportList lista)
            : base(isModal, parent, lista)
        {
            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 = WorkReportList.NewList().GetSortedList();
            SortProperty     = From.DataPropertyName;
            SortDirection    = ListSortDirection.Descending;
        }
        protected override void GetFormSourceData(long oid, object[] parameters)
        {
            _entity = Expedient.Get(oid, false);
            PgMng.Grow(string.Empty, "Expedient");

            _entity.LoadChilds(typeof(Batch), true, true);
            PgMng.Grow(string.Empty, "Partidas");

            _entity.LoadChilds(typeof(Expense), true, true);
            PgMng.Grow(string.Empty, "Gastos");

            _entity.UpdateGastosPartidas(true);
            _entity.UpdateTotalesProductos(_entity.Partidas, true);
            PgMng.Grow(string.Empty, "Updates");

            _work_reports = WorkReportList.GetByExpedientList(_entity.Oid, false);

            _entity.BeginEdit();
        }