// GET: data public ActionResult Index() { string[] filesLoc = Directory.GetFiles(Server.MapPath("~/Meta/")); foreach (string file in filesLoc) { DataViewModel result = new DataViewModel(); string fname = Path.GetFileName(file); if (file.Contains("-indexed-") == false) { string source = Server.MapPath(Path.Combine("/", "Meta/" + fname)); string symh = WDGetCustomProperty(source, "symh"); string tlang = WDGetCustomProperty(source, "tlang"); string olang = WDGetCustomProperty(source, "olang"); string sdate = WDGetCustomProperty(source, "sdate"); string anum = WDGetCustomProperty(source, "anum"); string atitle = WDGetCustomProperty(source, "atitle"); string count = WDGetCustomProperty(source, "countw"); string prep = WDGetCustomProperty(source, "prepwc"); string stitle = WDGetCustomProperty(source, "stitle"); string gdoc = WDGetCustomProperty(source, "gdoc"); string bar = WDGetCustomProperty(source, "bar"); string dist = WDGetCustomProperty(source, "dist"); string date = WDGetCustomProperty(source, "date"); string ldate = WDGetCustomProperty(source, "ldate"); string dname = WDGetCustomProperty(source, "dname"); string loca = WDGetCustomProperty(source, "loca"); string snum = WDGetCustomProperty(source, "snum"); string mnum = WDGetCustomProperty(source, "mnum"); string org = WDGetCustomProperty(source, "Org"); string entity = WDGetCustomProperty(source, "Entity"); string doctype = WDGetCustomProperty(source, "doctype"); string category = WDGetCustomProperty(source, "category"); string lname1 = WDGetCustomProperty(source, "lname1"); string lname2 = WDGetCustomProperty(source, "lname2"); string subcat = WDGetCustomProperty(source, "subcategory"); result.Org = org; result.Entity = entity; result.DocType = doctype; result.Category = category; result.Lname1 = lname1; result.Lname2 = lname2; result.Subcat = subcat; result.Anum = anum; result.Atitle = atitle; result.Bar = bar; result.Count = count; result.Date = date; result.Dist = dist; result.Dname = dname; result.Gdoc = gdoc; result.Ldate = ldate; result.Loca = loca; result.Mnum = mnum; result.Olang = olang; result.Prep = prep; result.Sdate = sdate; result.Snum = snum; result.Stitle = stitle; result.Symh = symh; result.Tlang = tlang; result.FName = fname; repo.Create(result); System.IO.File.Move(source, source + "-indexed-.docx"); } else { } } return(View()); }