コード例 #1
0
        private void Naviera_BT_Click(object sender, EventArgs e)
        {
            if (_entity.PuertoOrigen == string.Empty)
            {
                PgMng.ShowInfoException("Debe seleccionar un puerto de origen.");
                return;
            }

            if (_entity.PuertoDestino == string.Empty)
            {
                PgMng.ShowInfoException("Debe seleccionar un puerto de destino.");
                return;
            }

            ShippingCompanySelectForm form = new ShippingCompanySelectForm(this, moleQule.Base.EEstado.Active);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                _shipping_comnpany = (NavieraInfo)form.Selected;
                _entity.OidNaviera = _shipping_comnpany.Oid;
                _entity.Naviera    = _shipping_comnpany.Nombre;

                _entity.SetCode(ETipoAcreedor.Naviera);

                _shipping_comnpany = NavieraInfo.Get(_shipping_comnpany.Oid, true);
                _precio_naviera    = _shipping_comnpany.GetPrecioPuertoOrigen(_entity.PuertoOrigen, _entity.PuertoDestino);

                if (_precio_puerto != _precio_naviera)
                {
                    PgMng.ShowInfoException("El precio introducido no coincide con el precio estándar del puerto:" + Environment.NewLine +
                                            "   Precio del Puerto: " + _precio_puerto.ToString("C2") + Environment.NewLine +
                                            "   Precio de la Naviera: " + _precio_naviera.ToString("C2"));
                    return;
                }
            }
        }
コード例 #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;
            }
        }