// ***************************** ***************************** *****************************
 // constructor
 public DependenciaAddViewModel()
 {
     this._DependenciaRepository = new Protell.DAL.Repository.DependenciaRepository();
     this._Dependencia = new DependenciaModel()
     {
         IdDependencia = new UNID().getNewUNID(),
         IsActive = true
     };
 }
 // ***************************** ***************************** *****************************
 // constructor
 public DependenciaModViewModel(DependenciaModel p)
 {
     this._DependenciaRepository = new Protell.DAL.Repository.DependenciaRepository();
     this._Dependencia = new DependenciaModel()
     {
         IdDependencia = p.IdDependencia,
         DependenciaName = p.DependenciaName,
         IsActive = p.IsActive
     };
 }
        public bool CanSave()
        {
            bool _CanSave = false;

            if ((this._Dependencia != null) || !String.IsNullOrEmpty(this._Dependencia.DependenciaName))
            {
                _CanSave = true;
                this._CheckSave = this._DependenciaRepository.GetDependenciaMOD(this._Dependencia);

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

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

            return _CanSave;
        }