// ***************************** ***************************** *****************************
 // constructor
 public CondProModViewModel(CondProModel p)
 {
     this._CondProRepository = new Protell.DAL.Repository.CondProRepository();
     this._CondPro = new CondProModel() {
         IdCondicion = p.IdCondicion,
         CondicionName = p.CondicionName,
         IsActive = p.IsActive
     };
 }
 // ***************************** ***************************** *****************************
 // constructor
 public CondProAddViewModel()
 {
     this._CondProRepository = new Protell.DAL.Repository.CondProRepository();
     this._CondPro = new CondProModel()
     {
         IdCondicion = new UNID().getNewUNID(),
         IsActive = true
     };
 }
 public void GetActivoDesactivo(CondProModel auxCond)
 {
     foreach (var item in this.Condiciones)
     {
         if (auxCond.IdCondicion == item.IdCondicion)
         {
             item.IsChecked = true;
             item.IsEnabled = true;
         }
         else
         {
             item.IsChecked = false;
             item.IsEnabled = false;
         }
     }
 }
        public bool CanSave()
        {
            bool _CanSave = false;

            if ((this._CondPro != null) || !String.IsNullOrEmpty(this._CondPro.CondicionName))
            {
                _CanSave = true;
                this._CheckSave = this._CondProRepository.GetCondProMOD(this._CondPro);

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

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

            return _CanSave;
        }