protected override void DeleteWorkReportAction()
        {
            if (WorkReport_DGW.CurrentRow == null)
            {
                return;
            }
            if (WorkReport_DGW.CurrentRow.Index < 0)
            {
                return;
            }
            if (WorkReport_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            if (PgMng.ShowDeleteConfirmation() == DialogResult.Yes)
            {
                WorkReportInfo item = (WorkReportInfo)WorkReport_DGW.CurrentRow.DataBoundItem;
                WorkReport.Delete(item.Oid);
                _work_reports.Remove(item);

                WorkReport_BS.ResetBindings(false);
                UpdateWorkReportsTotals();
                LoadCategoriesExpenses(true);
            }
        }
        protected override void EditWorkReportAction()
        {
            if (WorkReport_DGW.CurrentRow == null)
            {
                return;
            }
            if (WorkReport_DGW.CurrentRow.Index < 0)
            {
                return;
            }
            if (WorkReport_DGW.CurrentRow.DataBoundItem == null)
            {
                return;
            }

            WorkReportInfo item = (WorkReportInfo)WorkReport_DGW.CurrentRow.DataBoundItem;

            WorkReportEditForm form = new WorkReportEditForm(item.Oid, this);

            form.ShowDialog(this);

            item.CopyFrom(form.Entity);

            WorkReport_BS.ResetBindings(false);
            UpdateWorkReportsTotals();
            LoadCategoriesExpenses(true);
        }
예제 #3
0
        public static OutputDeliveryList GetList(bool childs,
                                                 long oidHolder,
                                                 ETipoEntidad holderType,
                                                 long oidSerie,
                                                 ETipoAlbaranes deliveryType,
                                                 ETipoFactura invoiceType,
                                                 DateTime from,
                                                 DateTime till)
        {
            QueryConditions conditions = new QueryConditions
            {
                Serie         = (oidSerie != 0) ? SerieInfo.New(oidSerie) : null,
                TipoEntidad   = holderType,
                TipoAlbaranes = deliveryType,
                TipoFactura   = invoiceType,
                FechaIni      = from,
                FechaFin      = till,
            };

            switch (holderType)
            {
            case ETipoEntidad.Cliente:
                conditions.Cliente = (oidHolder != 0) ? ClienteInfo.New(oidHolder) : null;
                break;

            case ETipoEntidad.WorkReport:
                conditions.WorkReport = (oidHolder != 0) ? WorkReportInfo.New(oidHolder) : null;
                break;
            }

            return(GetList(childs, SELECT(conditions)));
        }
예제 #4
0
        public override void PrintObject()
        {
            PgMng.Reset(5, 1, Face.Resources.Messages.LOADING_DATA, this);

            OutputDeliveryReportMng reportMng = new OutputDeliveryReportMng(AppContext.ActiveSchema);

            OutputDeliveryInfo item = OutputDeliveryInfo.Get(EntityInfo.Oid, ETipoEntidad.WorkReport, true);

            PgMng.Grow();

            WorkReportInfo work_report = WorkReportInfo.Get(item.OidHolder, false);

            PgMng.Grow();

            ExpedientInfo work = ExpedientInfo.Get((work_report != null) ? work_report.OidExpedient : 0, false);

            PgMng.Grow();

            ReportClass report = reportMng.GetWorkDelivery(item, work);

            PgMng.FillUp();

            if (SettingsMng.Instance.GetUseDefaultPrinter())
            {
                int n_copias = SettingsMng.Instance.GetDefaultNCopies();
                PrintReport(report, n_copias);
            }
            else
            {
                ShowReport(report);
            }
        }
        protected virtual void SelectWorkReportAction()
        {
            WorkReportSelectForm form = new WorkReportSelectForm(this);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _work_report = form.Selected as WorkReportInfo;
                SetWorkReport(_work_report);
            }
        }
        public override void PrintDetailAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            WorkReportReportMng reportMng = new WorkReportReportMng(AppContext.ActiveSchema, Text, FilterValues);
            ReportClass         report    = reportMng.GetDetailReport(WorkReportInfo.Get(ActiveOID, true));

            ShowReport(report);
        }
        protected override void SetRowFormat(DataGridViewRow row)
        {
            if (row.IsNewRow)
            {
                return;
            }
            if (!row.Displayed)
            {
                return;
            }

            WorkReportInfo item = row.DataBoundItem as WorkReportInfo;

            Face.Common.ControlTools.Instance.SetRowColor(row, item.EStatus);
        }
        public override void RefreshSecondaryData()
        {
            if (_entity.OidSerie != 0)
            {
                SetSerie(SerieInfo.Get(_entity.OidSerie, false), false);
            }
            PgMng.Grow();

            if (_entity.OidAlmacen != 0)
            {
                SetAlmacen(StoreInfo.Get(_entity.OidAlmacen, false));
            }
            PgMng.Grow();

            switch (_entity.EHolderType)
            {
            case ETipoEntidad.WorkReport:
            {
                if (_work_report == null)
                {
                    _work_report = WorkReportInfo.GetByResource(_entity.Oid, ETipoEntidad.OutputDelivery, false);
                }
                SetWorkReport(_work_report);
            }
            break;

            case ETipoEntidad.Cliente:
            {
                if (_entity.OidHolder != 0)
                {
                    SetCliente(ClienteInfo.Get(_entity.OidHolder, false));
                }
                PgMng.Grow();

                if (_entity.OidExpediente != 0)
                {
                    SetExpediente(ExpedientInfo.Get(_entity.OidExpediente, false));
                }
                PgMng.Grow();
            }
            break;
            }

            base.RefreshSecondaryData();
        }
        protected void SetWorkReport(WorkReportInfo source)
        {
            if (source == null)
            {
                return;
            }

            _entity.OidHolder = source.Oid;

            WorkReport_BS.DataSource = source;

            ExpedientInfo expedient = ExpedientInfo.Get(source.OidExpedient, false);

            Expedient_BS.DataSource = expedient;

            _entity.IDCliente     = (expedient != null) ? expedient.Codigo : string.Empty;
            _entity.NombreCliente = (expedient != null) ? expedient.TipoMercancia : string.Empty;
        }
 public DeliveryAddForm(WorkReportInfo workReport, Form parent)
     : this(new object[3] {
     null, ETipoEntidad.WorkReport, workReport
 }, parent)
 {
 }
 protected override void GetFormSourceData(long oid)
 {
     _entity = WorkReportInfo.Get(oid, true);
 }