// ***************************** ***************************** ***************************** // constructor public DocumentosAddViewModel(DocumentosViewModel DocumentosViewModel) { this._ParentDocumentos = DocumentosViewModel; this._DocumentosRepository = new GestorDocument.DAL.Repository.DocumentosRepository(); this._TipoDocumentoRepository = new GestorDocument.DAL.Repository.TipoDocumentoRepository(); this.LoadGrid(); this._Documentos = new DocumentosModel() { IdDocumento = new UNID().getNewUNID(), //Fecha = DateTime.Now, IsActive = true }; }
public bool CanSave() { bool _CanSave = false; if ( (!String.IsNullOrEmpty(this._Documentos.DocumentoName)) && (!String.IsNullOrEmpty(this._Documentos.DocumentoPath)) && (!String.IsNullOrEmpty(this._Documentos.Extencion)) && (this._Documentos.Fecha != null) && (this._Documentos.TipoDocumento != null) && (this._Documentos != null) ) { _CanSave = true; this._CheckSave = this._DocumentosRepository.GetDocumentosAdd(this._Documentos); if (this._CheckSave != null) { _CanSave = false; ElementExists = "El elemento ya existe."; } else { _CanSave = true; ElementExists = ""; } } return _CanSave; }
public void GetDocumentosMod(DocumentosViewModel viewModel, DocumentosModel p) { this.DataContext = new DocumentosModViewModel(p, viewModel); }