Esempio n. 1
0
        public ActionResult List(DateTime bDate, DateTime eDate, string SearchType = "", int MinistryID = 0, string code = "", int codeID = 0, string CallerType = "", bool canEdit = true, string Requestor = "")
        {
            ViewBag.Requestor  = Requestor;
            ViewBag.CanEdit    = canEdit;
            ViewBag.CallerType = CallerType;
            ViewBag.MinistryID = MinistryID;

            GetData();
            IEnumerable <document> DocumentList;

            if (SearchType == "MinistrySearch")
            {
                DocumentList = DocumentRepository.GetDocumentByMinistry(MinistryID);
            }
            else if (SearchType == "StatusSearch")
            {
                DocumentList = DocumentRepository.GetDocumentByStatus(MinistryID, code);
            }
            else if (SearchType == "StatusOnlySearch")
            {
                DocumentList = DocumentRepository.GetDocumentByStatusOnly(code);
            }
            else if (SearchType == "DocumentTypeSearch")
            {
                DocumentList = DocumentRepository.GetDocumentByDocumentType(codeID);
            }
            else
            {
                DocumentList = DocumentRepository.GetAllDocument();
            }

            ViewBag.RecordCount = DocumentList.Count();

            return(PartialView(DocumentList));
        }
Esempio n. 2
0
        public ActionResult LatestDocument(int MinistryID)
        {
            GetData();
            IEnumerable <document> DocumentList;

            DocumentList = DocumentRepository.GetDocumentByMinistry(MinistryID);

            ViewBag.HasDocument = false;
            if (DocumentList.Count() > 0)
            {
                ViewBag.HasDocument = true;
            }
            return(PartialView(DocumentList));
        }