// ***************************** ***************************** *****************************
        // constructor
        public RegistroModViewModel(RegistroModel p)
        {
            //this._ParentRegistro = registroViewModel;
            this._RegistroRepository = new Protell.DAL.Repository.RegistroRepository();
            this._PuntoMedicionRepository = new Protell.DAL.Repository.PuntoMedicionRepository();
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
            this._CondProRepository = new Protell.DAL.Repository.CondProRepository();

            this._Registro = new RegistroModel()
            {
                IdRegistro = p.IdRegistro,
                PUNTOMEDICION = new PuntoMedicionModel()
                {
                    IdPuntoMedicion = p.IdPuntoMedicion,
                    PuntoMedicionName = p.PUNTOMEDICION.PuntoMedicionName
                },
                FechaCaptura = p.FechaCaptura,
                //HoraRegistro = p.HoraRegistro,
                HoraMilitar = p.HoraMilitar,
                DiaRegistro = p.DiaRegistro,
                Valor = p.Valor,
                AccionActual = p.AccionActual,
                IsActive = p.IsActive,
                Condicion = new CondProModel()
                {
                     IdCondicion = p.Condicion.IdCondicion,
                     CondicionName = p.Condicion.CondicionName
                },
            };
            this.LoadInfoGrid();
        }
        // ***************************** ***************************** *****************************
        // constructor
        public EstructuraModViewModel(EstructuraModel p)
        {
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
            this._Estructura = new EstructuraModel()
            {
                IdEstructura = p.IdEstructura,
                EstructuraName = p.EstructuraName,
                IsActive = p.IsActive,
                IdSistema=p.IdSistema
            };

            this._SistemaRepository = new Protell.DAL.Repository.SistemaRepository();
            this.LoadSistemas();

            var i = 0;
            foreach (SistemaModel v in this.Sistemas)
            {
                i++;
                if (v.IdSistema == this.Estructura.IdSistema)
                {
                    this.Estructura.IdSistema = this.Sistemas[i - 1].IdSistema;
                    break;
                }
            }
        }
예제 #3
0
    protected void Awake()
    {
        if (awaken)
        {
            return;
        }

        awaken = true;

        render     = GetComponent <SpriteRenderer>();
        estructura = GetComponent <IEstructura>();
    }
        // ***************************** ***************************** *****************************
        // constructor
        public EstructuraAddViewModel()
        {
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
            this._SistemaRepository = new Protell.DAL.Repository.SistemaRepository();
            this._Estructura = new EstructuraModel()
            {
                IdEstructura = new UNID().getNewUNID(),
                IsActive = true
            };

            this.LoadInfoGrid();
        }
        public RegistroAddViewModel(RegistroViewModel registroViewModel, IConfirmation confirmation)
        {
            this._ParentRegistro = registroViewModel;
            this._RegistroRepository = new Protell.DAL.Repository.RegistroRepository();
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
            this._CondProRepository = new Protell.DAL.Repository.CondProRepository();
            this._PuntoMedicionMaxMinRepository = new Protell.DAL.Repository.PuntoMedicionMaxMinRepository();
            this._Confirmation = confirmation;

            this.GetNewRegistro();

            this.LoadInfo();
        }
        // ***************************** ***************************** *****************************
        // constructor
        public EstPuntoMedAddViewModel()
        {
            this._EstPuntoMedRepository = new Protell.DAL.Repository.EstPuntoMedRepository();
            this._PuntoMedicionRepository = new Protell.DAL.Repository.PuntoMedicionRepository();
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();

            this._EstPuntoMed = new EstPuntoMedModel()
            {
                IdEstPuntoMed = new UNID().getNewUNID(),
                IsActive = true
            };

            this.LoadInfoGrid();
        }
        // ***************************** ***************************** *****************************
        // constructor
        public EstructuraDependenciaAddViewModel()
        {
            this._EstructuraDependenciaRepository = new Protell.DAL.Repository.EstructuraDependenciaRepository();
            this._DependenciaRepository = new Protell.DAL.Repository.DependenciaRepository();
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();

            this._EstructuraDependencia = new EstructuraDependenciaModel()
            {
                IdEstructuraDependencia = new UNID().getNewUNID(),
                IsActive = true
            };

            this.LoadInfoGrid();
        }
        // ***************************** ***************************** *****************************
        // constructor
        public EstructuraDependenciaModViewModel(EstructuraDependenciaModel p)
        {
            this._EstructuraDependenciaRepository = new Protell.DAL.Repository.EstructuraDependenciaRepository();

            this._EstructuraDependencia = new EstructuraDependenciaModel() {
                IdEstructuraDependencia = p.IdEstructuraDependencia,
                DEPENDENCIA = new DependenciaModel()
                {
                    IdDependencia = p.DEPENDENCIA.IdDependencia,
                    DependenciaName = p.DEPENDENCIA.DependenciaName
                },
                ESTRUCTURA = new EstructuraModel()
                {
                    IdEstructura = p.ESTRUCTURA.IdEstructura,
                    EstructuraName = p.ESTRUCTURA.EstructuraName
                },
                IsActive = p.IsActive
            };

            this._DependenciaRepository = new Protell.DAL.Repository.DependenciaRepository();
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
            this.LoadInfo();

            var i = 0;
            foreach (DependenciaModel v in this.Dependencias)
            {
                i++;
                if (v.IdDependencia == this.EstructuraDependencia.DEPENDENCIA.IdDependencia)
                {
                    this.EstructuraDependencia.DEPENDENCIA = this.Dependencias[i - 1];
                    break;
                }
            }

            var j = 0;
            foreach (EstructuraModel v in this.Estructuras)
            {
                j++;
                if (v.IdEstructura == this.EstructuraDependencia.ESTRUCTURA.IdEstructura)
                {
                    this.EstructuraDependencia.ESTRUCTURA = this.Estructuras[j - 1];
                    break;
                }
            }
        }
        // ***************************** ***************************** *****************************
        // constructor
        public EstPuntoMedModViewModel(EstPuntoMedModel p)
        {
            this._EstPuntoMedRepository = new Protell.DAL.Repository.EstPuntoMedRepository();
            this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
            this._PuntoMedicionRepository = new Protell.DAL.Repository.PuntoMedicionRepository();

            this._EstPuntoMed = new EstPuntoMedModel() {
            IdEstPuntoMed = p.IdEstPuntoMed,
            ESTRUCTURA = new EstructuraModel()
            {
                IdEstructura = p.IdEstructura,
                EstructuraName = p.ESTRUCTURA.EstructuraName
            },
            PUNTOMEDICION = new PuntoMedicionModel()
            {
                IdPuntoMedicion = p.IdPuntoMedicion,
                PuntoMedicionName = p.PUNTOMEDICION.PuntoMedicionName
            },
            IsActive = true
            };
            this.LoadInfoGrid();

            var i = 0;
            foreach (PuntoMedicionModel v in this.PuntoMedicions)
            {
                i++;
                if (v.IdPuntoMedicion == this.EstPuntoMed.PUNTOMEDICION.IdPuntoMedicion)
                {
                    this.EstPuntoMed.PUNTOMEDICION = this.PuntoMedicions[i - 1];
                    break;
                }
            }

            var j = 0;
            foreach (EstructuraModel v in this.Estructuras)
            {
                j++;
                if (v.IdEstructura == this.EstPuntoMed.ESTRUCTURA.IdEstructura)
                {
                    this.EstPuntoMed.ESTRUCTURA = this.Estructuras[j - 1];
                    break;
                }
            }
        }
 // ***************************** ***************************** *****************************
 // Constructor y carga de elementos.
 public EstructuraViewModel()
 {
     this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
     this.LoadInfoGrid();
 }
 private void LoadPropiedades()
 {
     syncLogRepository = new SyncLogRepository();
     _SistemaRepository = new SistemaRepository();
     _RegistroRepository = new RegistroRepository();
     _ServerLastDataRepository = new ServerLastDataRepository();
     _UploadLogRepository = new UploadLogRepository();
     _EvidenceSyncRepository = new EvidenceSyncRepository();
     _SyncRepository = new SyncRepository();
     _CondProRepository = new CondProRepository();
     _DependenciaRepository = new DependenciaRepository();
     _EstPuntoMedRepository = new EstPuntoMedRepository();
     _EstructuraRepository = new EstructuraRepository();
     _EstructuraDependenciaRepository = new EstructuraDependenciaRepository();
     _PuntoMedicionRepository = new PuntoMedicionRepository();
     _TipoPuntoMedicionRepository = new TipoPuntoMedicionRepository();
     _UnidadMedidaRepository = new UnidadMedidaRepository();
     //_ConsideracionRepository = new ConsideracionRepository();
     //_AccionProtocoloRepository = new AccionProtocoloRepository();
     _CnfSettingRepository = new CnfSettingRepository();
     routeService = ConfigurationManager.AppSettings["RutaServicioSubida"].ToString();
     routeDownload = ConfigurationManager.AppSettings["RutaServicioDescarga"].ToString();
     basicAuthUser = ConfigurationManager.AppSettings["basicAuthUser"].ToString();
     basicAuthPass = ConfigurationManager.AppSettings["basicAuthPass"].ToString();
     contador = int.Parse(ConfigurationManager.AppSettings["ContSettings"].ToString());
     TopLog = int.Parse(ConfigurationManager.AppSettings["TopLog"].ToString());
 }
 // ***************************** ***************************** *****************************
 // Constructor y carga de elementos.
 public PuntoMedicionEstructuraViewModel(PuntoMedicionAddViewModel addviewmodel)
 {
     this.addviewmodel = addviewmodel;
     this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
     this.LoadInfoGrid();
 }
 // ***************************** ***************************** *****************************
 // constructor que recibe un viewmodel
 public RegistroModViewModel(RegistroViewModel registroViewModel, RegistroModel p, IConfirmation confirmation)
 {
     this._ParentRegistro = registroViewModel;
     this._RegistroRepository = new Protell.DAL.Repository.RegistroRepository();
     //this._PuntoMedicionRepository = new Protell.DAL.Repository.PuntoMedicionRepository();
     this._PuntoMedicionMaxMinRepository = new Protell.DAL.Repository.PuntoMedicionMaxMinRepository();
     this._EstructuraRepository = new Protell.DAL.Repository.EstructuraRepository();
     this._CondProRepository = new Protell.DAL.Repository.CondProRepository();
     this._Confirmation = confirmation;
     this._Registro = new RegistroModel()
     {
         IdRegistro = p.IdRegistro,
         PUNTOMEDICION = new PuntoMedicionModel()
         {
             IdPuntoMedicion = p.IdPuntoMedicion,
             PuntoMedicionName = p.PUNTOMEDICION.PuntoMedicionName,
             Visibility = p.PUNTOMEDICION.Visibility,
             UIVisible = p.PUNTOMEDICION.UIVisible,
             TIPOPUNTOMEDICION = new TipoPuntoMedicionModel()
             {
                 TipoPuntoMedicionName = p.PUNTOMEDICION.TIPOPUNTOMEDICION.TipoPuntoMedicionName
             },
             UNIDADMEDIDA = new UnidadMedidaModel()
             {
                 UnidadMedidaName = p.PUNTOMEDICION.UNIDADMEDIDA.UnidadMedidaName,
                 UnidadMedidaShort = p.PUNTOMEDICION.UNIDADMEDIDA.UnidadMedidaShort
             }
         },
         FechaCaptura = p.FechaCaptura,
         HoraRegistro = p.HoraRegistro,
         DiaRegistro = p.DiaRegistro,
         Valor = p.Valor,
         AccionActual = p.AccionActual,
         IsActive = p.IsActive,
         Condicion = new CondProModel()
         {
             IdCondicion = p.Condicion.IdCondicion,
             CondicionName= p.Condicion.CondicionName,
             PathCodicion = p.Condicion.PathCodicion
         }
     };
     this.FechaCapturaActual = this.Registro.FechaCaptura;
     this.HoraMilitarActual = this.Registro.HoraMilitar;
     this.LoadInfoGrid();
 }