Ejemplo n.º 1
0
        public List <Document_Details> SearchByDocumentName(string name)
        {
            var DocumentsList = new List <Document_Details>();

            try
            {
                if (name == null)
                {
                    throw new ELibException("Name should not be null");
                }

                var DocumentDetailsDALObj = new Document_DetailsOperations();
                DocumentsList = DocumentDetailsDALObj.SearchDocumentByName(name);

                if (DocumentsList.Count == 0)
                {
                    throw new ELibException("No such Document exists");
                }
            }
            catch (ELibException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ELibException("Error searching Document", ex);
            }
            return(DocumentsList);
        }
Ejemplo n.º 2
0
        public List <Document_Details> SearchByDocumentId(int id)
        {
            var DocumentsList = new List <Document_Details>();

            try
            {
                if (id <= 0)
                {
                    throw new ELibException("Id should be greater than 0");
                }

                var DocumentDetailsDALObj = new Document_DetailsOperations();
                DocumentsList = DocumentDetailsDALObj.SearchDocumentById(id);

                if (DocumentsList == null)
                {
                    throw new ELibException("No such Document exists");
                }
            }
            catch (ELibException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ELibException("Error searching Document", ex);
            }
            return(DocumentsList);
        }
Ejemplo n.º 3
0
        public bool UploadDocument(Document_Details documentObj)
        {
            var IsAdded = false;

            try
            {
                if (ValidateDocuments(documentObj))
                {
                    var DALObj = new Document_DetailsOperations();
                    IsAdded = DALObj.UploadDocument(documentObj);
                }
            }
            catch (ELibException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ELibException("Unknown error", ex);
            }
            return(IsAdded);
        }
Ejemplo n.º 4
0
        public bool UpdateDocument(Document_Details DocumentObj)
        {
            var IsUpdated = false;

            try
            {
                if (ValidateDocuments(DocumentObj))
                {
                    var ObjDAL = new Document_DetailsOperations();

                    IsUpdated = ObjDAL.UpdateDocument(DocumentObj);
                }
            }
            catch (ELibException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ELibException("Error editing Document details", ex);
            }
            return(IsUpdated);
        }
Ejemplo n.º 5
0
        public List <Document_Details> BrowseDocuments(int disciplineIdSelected)
        {
            var DocumentDetailsList = new List <Document_Details>();

            try
            {
                var ObjDAL = new Document_DetailsOperations();
                DocumentDetailsList = ObjDAL.BrowseDocuments(disciplineIdSelected);
                if (DocumentDetailsList == null || DocumentDetailsList.Count == 0)
                {
                    throw new ELibException("Document are not present");
                }
            }
            catch (ELibException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ELibException("Unknown error", ex);
            }
            return(DocumentDetailsList);
        }
Ejemplo n.º 6
0
        public bool Delete(int id)
        {
            var IsDeleted = false;

            try
            {
                if (id <= 0)
                {
                    throw new ELibException("Id should be greater than 0");
                }

                var ObjDAL = new Document_DetailsOperations();
                IsDeleted = ObjDAL.Delete(id);
            }
            catch (ELibException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new ELibException("Failed to remove document", ex);
            }
            return(IsDeleted);
        }