Пример #1
0
        // GET: Doc/FastEntry
        public ActionResult FastEntry(Guid type)
        {
            var model   = new FastEntryViewModel();
            var docType = DocTypeRepository.Read(type);

            model.MetaTags = MetaTagRepository.ReadMany(docType.MetaTags);
            model.Type     = docType.Name;
            model.TypeId   = type;

            model.AutoCompletes = new Dictionary <string, List <string> >();

            foreach (var metaTag in model.MetaTags.Where(m => m.DataType == "string").ToList())
            {
                model.AutoCompletes.Add(metaTag.Name, DocRepository.GetUniqueStringValuesByMetaTagName(metaTag.Name));
            }

            return(View(model));
        }
Пример #2
0
        // GET: Doc/Create
        public ActionResult Create(Guid type)
        {
            var model   = new DocViewModel();
            var docType = DocTypeRepository.Read(type);

            model.MetaTags = MetaTagRepository.ReadMany(docType.MetaTags);
            model.Type     = docType.Name;

            model.AutoCompletes = new Dictionary <string, List <string> >();

            foreach (var metaTag in model.MetaTags.Where(m => m.DataType == "string").ToList())
            {
                model.AutoCompletes.Add(metaTag.Name, DocRepository.GetUniqueStringValuesByMetaTagName(metaTag.Name));
            }

            model.MostRecentDocuments = DocRepository.GetMostRecentDocumentsForDocType(type, -90);

            return(View(model));
        }
Пример #3
0
        // GET: Doc/Edit/5
        public ActionResult Edit(Guid id)
        {
            var model = new DocViewModel();

            var doc = DocRepository.Read(id);

            var docType = DocTypeRepository.Read(Guid.Parse(doc.type));

            model.MetaTags = MetaTagRepository.ReadMany(docType.MetaTags);
            model.Id       = Guid.Parse(doc.id);
            model.Type     = docType.Name;
            model.TypeId   = docType.Id;

            model.Values = mapMetaTagsAndDocValue(model.MetaTags, doc);

            model.AutoCompletes = new Dictionary <string, List <string> >();

            foreach (var metaTag in model.MetaTags.Where(m => m.DataType == "string").ToList())
            {
                model.AutoCompletes.Add(metaTag.Name, DocRepository.GetUniqueStringValuesByMetaTagName(metaTag.Name));
            }

            return(View(model));
        }