// ***************************** ***************************** *****************************
        // 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;
                }
            }
        }
        // ***************************** ***************************** *****************************
        // 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 bool CanSave()
        {
            bool _CanSave = false;

            if ((this._Estructura != null) || !String.IsNullOrEmpty(this._Estructura.EstructuraName))
            {
                _CanSave = true;
                this._CheckSave = this._EstructuraRepository.GetEstructuraADD(this._Estructura);

                if (this._CheckSave != null)
                {
                    _CanSave = false;
                    ElementExists = "El elemento ya existe.";

                }
                else
                {
                    _CanSave = true;
                    ElementExists = "";
                }
            }

            return _CanSave;
        }