Example #1
0
        private void BindReferenciaGeografica(IAutoBindeable lin)
        {
            var cbReferenciaGeograficaWrapper = new DropDownListBaseWrapper <ReferenciaGeografica>(cbReferenciaGeografica);

            cbReferenciaGeograficaWrapper.AddParent <TipoReferenciaGeografica>(cbTipoReferenciaGeografica);

            if (lin != null)
            {
                cbReferenciaGeograficaWrapper.AddParent <Linea>(lin);
            }

            cbReferenciaGeograficaWrapper.BindingManager.BindReferenciaGeografica(cbReferenciaGeograficaWrapper);
        }
Example #2
0
        protected virtual void AddLinea(string id, string style)
        {
            var cbLinea = new DropDownList {
                ID = id, Width = Unit.Pixel(200)
            };

            cbLinea.Style.Value = style;
            var cbEmpresa = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI01) as DropDownList;

            var ddlLinea = new DropDownListBaseWrapper <Linea>(cbLinea, TipoDocumento.Linea == null);

            ddlLinea.AddParent <Empresa>(cbEmpresa);

            if (TipoDocumento.Linea != null)
            {
                BindingManager.BindPlanta(ddlLinea, TipoDocumento.Linea.Id);
            }
            else
            {
                BindingManager.BindPlanta(ddlLinea);
            }

            if (cbEmpresa != null)
            {
                cbEmpresa.SelectedIndexChanged += cbEmpresa_SelectedIndexChanged;
                cbEmpresa.AutoPostBack          = true;
                AddChildrenToControl(cbEmpresa.ID, id, BINDLINEA);
            }

            AddControlToView(cbLinea);
        }
Example #3
0
        private void BindTipoEventos(IAutoBindeable lin)
        {
            var cbTipoEventoWrapper = new DropDownListBaseWrapper <TipoMensaje>(cbTipoEvento);

            if (lin != null)
            {
                cbTipoEventoWrapper.AddParent <Linea>(lin);
            }

            cbTipoEventoWrapper.BindingManager.BindTipoMensaje(cbTipoEventoWrapper);
        }
Example #4
0
        private void BindTipo(IAutoBindeable lin)
        {
            var cbTipoWrapper = new DropDownListBaseWrapper <String>(cbTipo);

            cbTipoWrapper.BindingManager.BindTipoDetalleCiclo(cbTipoWrapper);

            if (lin != null)
            {
                cbTipoWrapper.AddParent <Linea>(lin);
            }
        }
Example #5
0
        protected virtual void cbEmpresa_SelectedIndexChanged(object sender, EventArgs e)
        {
            var cbEmpresa = sender as DropDownList;

            if (cbEmpresa == null)
            {
                return;
            }

            var childs = GetChildrenForControl(cbEmpresa.ID);

            foreach (var child in childs)
            {
                if (child.StartsWith(BINDCOCHE))
                {
                    var id         = child.Substring(BINDCOCHE.Length);
                    var cbVehiculo = GetControlFromView(id) as DropDownList;
                    var all        = cbVehiculo.Attributes["AddAll"] == "1";

                    var cbLinea         = GetControlFromView(id) as DropDownList;
                    var cbTransportista = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI07) as DropDownList;

                    var cbVehiculoWrapper = new MovilDropDownListWrapper(cbVehiculo, false);
                    cbVehiculoWrapper.AddParent <Empresa>(cbEmpresa);
                    cbVehiculoWrapper.AddParent <Linea>(cbLinea);
                    if (cbTransportista != null)
                    {
                        cbVehiculoWrapper.AddParent <Transportista>(cbTransportista);
                    }
                    cbVehiculoWrapper.AddAllItem = all;

                    BindingManager.BindMovil(cbVehiculoWrapper);
                }
                else if (child.StartsWith(BINDLINEA))
                {
                    var id      = child.Substring(BINDLINEA.Length);
                    var cbLinea = GetControlFromView(id) as DropDownList;

                    var ddlLinea = new DropDownListBaseWrapper <Linea>(cbLinea, TipoDocumento.Linea == null);
                    ddlLinea.AddParent <Empresa>(cbEmpresa);

                    if (TipoDocumento.Linea != null)
                    {
                        BindingManager.BindPlanta(ddlLinea, TipoDocumento.Linea.Id);
                    }
                    else
                    {
                        BindingManager.BindPlanta(ddlLinea);
                    }
                }
                else if (child.StartsWith(BINDTRANSPORTISTA))
                {
                    var id      = child.Substring(BINDTRANSPORTISTA.Length);
                    var cbTrans = GetControlFromView(id) as DropDownList;
                    var cbLinea = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI02) as DropDownList;
                    var all     = cbTrans.Attributes["AddAllItem"] == "1";

                    var ddlTransportista = new TransportistaDropDownListWrapper(cbTrans, all);
                    ddlTransportista.AddParent <Linea>(cbLinea);

                    BindingManager.BindTransportista(ddlTransportista);
                }
                else if (child.StartsWith(BINDEQUIPO))
                {
                    var id = child.Substring(BINDEQUIPO.Length);

                    var cbLinea  = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI02) as DropDownList;
                    var cbEquipo = GetControlFromView(id) as DropDownList;

                    var ddlEquipo = new EquipoDropDownListWrapper(cbEquipo);
                    ddlEquipo.AddParent <Empresa>(cbEmpresa);
                    ddlEquipo.AddParent <Linea>(cbLinea);

                    BindingManager.BindEquipo(ddlEquipo);
                }
                else if (child.StartsWith(BINDEMPLEADO))
                {
                    var id = child.Substring(BINDEMPLEADO.Length);

                    var cbEmpleado = GetControlFromView(id) as DropDownList;
                    var cbLinea    = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI02) as DropDownList;

                    var all = cbEmpleado.Attributes["AddSinEmpleado"] == "1";

                    var cbEmpleadoWrapper = new EmpleadoDropDownListWrapper(cbEmpleado, false, all);
                    cbEmpleadoWrapper.AddParent <Empresa>(cbEmpresa);
                    cbEmpleadoWrapper.AddParent <Linea>(cbLinea);

                    BindingManager.BindEmpleados(cbEmpleadoWrapper);
                }
                else if (child.StartsWith(BINDCLIENTE))
                {
                    var id               = child.Substring(BINDCLIENTE.Length);
                    var cbCliente        = GetControlFromView(id) as DropDownList;
                    var cbLinea          = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI02) as DropDownList;
                    var all              = cbCliente.Attributes["AddAllItem"] == "1";
                    var cbClienteWrapper = new ClienteDropDownListWrapper(cbCliente, all);
                    cbClienteWrapper.AddParent <Empresa>(cbEmpresa);
                    cbClienteWrapper.AddParent <Linea>(cbLinea);
                    BindingManager.BindCliente(cbClienteWrapper);
                }
                else if (child.StartsWith(BINDCENTRODECOSTO))
                {
                    var id = child.Substring(BINDCENTRODECOSTO.Length);
                    var cbCentroDeCosto        = GetControlFromView(id) as DropDownList;
                    var cbLinea                = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI02) as DropDownList;
                    var all                    = cbCentroDeCosto.Attributes["AddAllItem"] == "1";
                    var cbCentroDeCostoWrapper = new CentroDeCostoDropDownListWrapper(cbCentroDeCosto, all);
                    cbCentroDeCostoWrapper.AddParent <Empresa>(cbEmpresa);
                    cbCentroDeCostoWrapper.AddParent <Linea>(cbLinea);
                    BindingManager.BindCentroDeCostos(cbCentroDeCostoWrapper);
                }
                else if (child.StartsWith(BINDTANQUE))
                {
                    var id              = child.Substring(BINDTANQUE.Length);
                    var cbTanque        = GetControlFromView(id) as DropDownList;
                    var cbEquipo        = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI19) as DropDownList;
                    var cbLinea         = GetControlFromView(TipoDocumentoHelper.CONTROL_NAME_PARENTI02) as DropDownList;
                    var all             = cbTanque.Attributes["AddAllItem"] == "1";
                    var cbTanqueWrapper = new TanqueDropDownListWrapper(cbTanque, all);
                    cbTanqueWrapper.AddParent <Empresa>(cbEmpresa);
                    cbTanqueWrapper.AddParent <Linea>(cbLinea);
                    cbTanqueWrapper.AddParent <Equipo>(cbEquipo);
                    BindingManager.BindTanque(cbTanqueWrapper);
                }
            }
        }