コード例 #1
0
        protected override void SetRowFormat(DataGridViewRow row)
        {
            if (!row.Displayed)
            {
                return;
            }
            if (row.IsNewRow)
            {
                return;
            }

            DespachanteInfo item = row.DataBoundItem as DespachanteInfo;

            Face.Common.ControlTools.Instance.SetRowColor(row, item.EEstado);
        }
コード例 #2
0
        private void Despachante_BT_Click(object sender, EventArgs e)
        {
            if (_entity.PuertoDestino == string.Empty)
            {
                PgMng.ShowInfoException("Debe seleccionar un puerto de destino.");
                return;
            }

            PuertoList pl = PuertoList.GetList(true);
            PuertoInfo pi = pl.GetItemByProperty("Valor", _entity.PuertoDestino);

            DespachanteList despachantes = PuertoDespachanteList.GetDespachanteList(pi.Oid);

            CustomAgentSelectForm form = new CustomAgentSelectForm(this, despachantes);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _custom_agency         = form.Selected as DespachanteInfo;
                _entity.OidDespachante = _custom_agency.Oid;
                _entity.Despachante    = _custom_agency.Nombre;

                Datos.ResetBindings(false);
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        private void Detalle_BT_Click(object sender, EventArgs e)
        {
            switch ((ETipoInforme)(long)TipoAcreedor_CB.SelectedValue)
            {
            case ETipoInforme.Despachante:
            {
                CustomAgentSelectForm form = new CustomAgentSelectForm(this, moleQule.Base.EEstado.Active);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    DespachanteInfo d = form.Selected as DespachanteInfo;
                    Acreedores_TB.Text = d.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.Naviera:
            {
                ShippingCompanySelectForm form = new ShippingCompanySelectForm(this, moleQule.Base.EEstado.Active);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    NavieraInfo n = form.Selected as NavieraInfo;
                    Acreedores_TB.Text = n.Codigo + " - " + n.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.Proveedor:
            {
                ProveedorList      list = ProveedorList.GetList(moleQule.Base.EEstado.Active, false);
                SupplierSelectForm form = new SupplierSelectForm(this, list);

                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    ProveedorInfo p = form.Selected as ProveedorInfo;
                    Acreedores_TB.Text = p.Codigo + " - " + p.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.TransportistaDestino:
            {
                TransporterSelectForm form = new TransporterSelectForm(this, TransporterList.GetList(ETipoTransportista.Destino, false));
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    TransporterInfo t = (TransporterInfo)form.Selected;
                    Acreedores_TB.Text = t.Codigo + " - " + t.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;

            case ETipoInforme.TransportistaOrigen:
            {
                TransporterSelectForm form = new TransporterSelectForm(this, TransporterList.GetList(ETipoTransportista.Origen, false));
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    TransporterInfo t = (TransporterInfo)form.Selected;
                    Acreedores_TB.Text = t.Codigo + " - " + t.Nombre;
                    _report_filter.objeto_detallado = form.Selected;
                }
            }
            break;
            }
        }
コード例 #5
0
 protected override void GetFormSourceData(long oid, object[] parameters)
 {
     _entity  = DespachanteInfo.Get(oid, true);
     _mf_type = ManagerFormType.MFView;
 }