Example #1
0
 public override void ShowDocumentsAction()
 {
     try
     {
         AgenteInfo     agent = AgenteInfo.Get(ActiveItem.TipoEntidad, ActiveItem);
         AgenteEditForm form  = new AgenteEditForm(ActiveItem.TipoEntidad, ActiveItem, this);
         AddForm(form);
     }
     catch
     {
         AgenteAddForm form = new AgenteAddForm(ActiveItem.TipoEntidad, ActiveItem, this);
         AddForm(form);
     }
 }
 protected override void DocumentsAction()
 {
     try
     {
         AgenteEditForm form = new AgenteEditForm(typeof(Product), EntityInfo as IAgenteHipatia);
         form.ShowDialog(this);
     }
     catch (HipatiaException ex)
     {
         if (ex.Code == HipatiaCode.NO_AGENTE)
         {
             AgenteAddForm form = new AgenteAddForm(typeof(Product), EntityInfo as IAgenteHipatia);
             form.ShowDialog(this);
         }
     }
 }
Example #3
0
 public override void ShowDocumentsAction()
 {
     try
     {
         AgenteInfo     agent = AgenteInfo.Get(ActiveItem.TipoEntidad, ActiveItem);
         AgenteEditForm form  = new AgenteEditForm(ActiveItem.TipoEntidad, ActiveItem, this);
         AddForm(form);
     }
     catch (HipatiaException ex)
     {
         if (ex.Code == HipatiaCode.NO_AGENTE)
         {
             AgenteAddForm form = new AgenteAddForm(ActiveItem.TipoEntidad, ActiveItem, this);
             AddForm(form);
         }
     }
 }
 protected override void DocumentsAction()
 {
     try
     {
         AgenteEditForm form = new AgenteEditForm(typeof(Charge), Cobro as IAgenteHipatia);
         form.ShowDialog(this);
     }
     catch (HipatiaException ex)
     {
         if (ex.Code == HipatiaCode.NO_AGENTE)
         {
             AgenteAddForm form = new AgenteAddForm(typeof(Charge), Cobro as IAgenteHipatia);
             form.ShowDialog(this);
         }
         else
         {
             MessageBox.Show(ex.Message, moleQule.Face.Resources.Labels.ERROR_TITLE);
         }
     }
 }
        protected override void AdjuntarDocumentosFomentoAction()
        {
            if (Fomento_DGW.CurrentRow == null)
            {
                return;
            }

            LineaFomento item = (LineaFomento)Fomento_DGW.CurrentRow.DataBoundItem;

            try
            {
                AgenteEditForm form = new AgenteEditForm(typeof(LineaFomento), item as IAgenteHipatia, this);
                form.ShowDialog(this);
            }
            catch (HipatiaException ex)
            {
                if (ex.Code == HipatiaCode.NO_AGENTE)
                {
                    AgenteAddForm form = new AgenteAddForm(typeof(LineaFomento), item as IAgenteHipatia, this);
                    form.ShowDialog(this);
                }
            }
        }
        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;
            }
        }