public override void ShowDocumentsAction()
        {
            switch (ActiveItem.ETipoAcreedor)
            {
            case ETipoAcreedor.Acreedor:
            case ETipoAcreedor.Proveedor:
            {
                ProveedorInfo agente = ProveedorInfo.Get(ActiveItem.Oid, ActiveItem.ETipoAcreedor, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Proveedor), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Proveedor), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Proveedor), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;

            case ETipoAcreedor.Naviera:
            {
                NavieraInfo agente = NavieraInfo.Get(ActiveItem.Oid, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Naviera), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Naviera), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Naviera), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;

            case ETipoAcreedor.Despachante:
            {
                DespachanteInfo agente = DespachanteInfo.Get(ActiveItem.Oid, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Despachante), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Despachante), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Despachante), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;

            case ETipoAcreedor.TransportistaOrigen:
            case ETipoAcreedor.TransportistaDestino:
            {
                TransporterInfo agente = TransporterInfo.Get(ActiveItem.Oid, ActiveItem.ETipoAcreedor, false);

                try
                {
                    AgenteInfo     agent = AgenteInfo.Get(typeof(Transporter), agente);
                    AgenteEditForm form  = new AgenteEditForm(typeof(Transporter), agente, this);
                    AddForm(form);
                }
                catch (HipatiaException ex)
                {
                    if (ex.Code == HipatiaCode.NO_AGENTE)
                    {
                        AgenteAddForm form = new AgenteAddForm(typeof(Transporter), agente, this);
                        AddForm(form);
                    }
                }
            }
            break;
            }
        }
Пример #2
0
 protected override void GetFormSourceData(long oid, object[] parameters)
 {
     _entity  = DespachanteInfo.Get(oid, true);
     _mf_type = ManagerFormType.MFView;
 }