コード例 #1
0
ファイル: DocumentList.ascx.cs プロジェクト: jesumarquez/lt
 public void DisableCombos()
 {
     EnableCombo(TipoDocumentoHelper.CONTROL_NAME_PARENTI07, Transportista.Get() == -1);
     EnableCombo(TipoDocumentoHelper.CONTROL_NAME_PARENTI03, Coche.Get() == -1);
     EnableCombo(TipoDocumentoHelper.CONTROL_NAME_PARENTI09, Empleado.Get() == -1);
     EnableCombo(TipoDocumentoHelper.CONTROL_NAME_PARENTI19, Equipo.Get() == -1);
     EnableCombo(TipoDocumentoHelper.CONTROL_NAME_PARENTI01, false);
     EnableCombo(TipoDocumentoHelper.CONTROL_NAME_PARENTI02, false);
 }
コード例 #2
0
ファイル: DocumentList.ascx.cs プロジェクト: jesumarquez/lt
        public void SetCurrentValues(TipoDocumento tipoDocumento)
        {
            ISecurable ent = null;

            if (Coche.Get() != -1)
            {
                ent = DAOFactory.CocheDAO.FindById(Coche.Get());
            }
            else if (Empleado.Get() != -1)
            {
                ent = DAOFactory.EmpleadoDAO.FindById(Empleado.Get());
            }
            else if (Equipo.Get() != -1)
            {
                ent = DAOFactory.EquipoDAO.FindById(Equipo.Get());
            }
            else if (Transportista.Get() != -1)
            {
                ent = DAOFactory.TransportistaDAO.FindById(Transportista.Get());
            }

            var doc = new Documento();

            if (ent != null)
            {
                doc.Empresa = ent.Empresa;
                doc.Linea   = ent.Linea;
            }
            if (tipoDocumento.AplicarATransportista && Transportista.Get() != -1)
            {
                doc.Transportista = DAOFactory.TransportistaDAO.FindById(Transportista.Get());
            }
            if (tipoDocumento.AplicarAEquipo && Equipo.Get() != -1)
            {
                doc.Equipo = DAOFactory.EquipoDAO.FindById(Equipo.Get());
            }
            if (tipoDocumento.AplicarAEmpleado && Empleado.Get() != -1)
            {
                doc.Empleado = DAOFactory.EmpleadoDAO.FindById(Empleado.Get());
            }
            if (tipoDocumento.AplicarAVehiculo && Coche.Get() != -1)
            {
                doc.Vehiculo = DAOFactory.CocheDAO.FindById(Coche.Get());
            }

            Presenter.SetValores(doc);
        }
コード例 #3
0
ファイル: DocumentList.ascx.cs プロジェクト: jesumarquez/lt
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            GridUtils.GenerateColumnIndices();

            if (multiDocumentos.ActiveViewIndex == 1)
            {
                DocumentContainer.EnableViewState = false;
                var tipoDocumento = DAOFactory.TipoDocumentoDAO.FindById(TipoDocumentoEdit.Get());
                Presenter = GetPresentStrategy(tipoDocumento);
                Presenter.CrearForm();
                DocumentContainer.EnableViewState = true;
            }

            if (!IsPostBack)
            {
                btBorrar.OnClientClick = string.Concat("return confirm('", CultureManager.GetString("SystemMessages", "CONFIRM_OPERATION"), "');");

                btNuevo.Visible = cbTipoDocumento.Visible = Permission == null || Permission.Add;

                if (OnlyForVehicles && Coche.Get() <= 0)
                {
                    Visible = false;
                }
                if (OnlyForEmployees && Empleado.Get() <= 0)
                {
                    Visible = false;
                }
                if (OnlyForEquipment && Equipo.Get() <= 0)
                {
                    Visible = false;
                }
                if (OnlyForTransporter && Transportista.Get() <= 0)
                {
                    Visible = false;
                }
            }
        }