コード例 #1
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);
            }
        }
コード例 #2
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;
            }
        }