//[RecordCall] //[LogExceptions] //[Diagnose] //[MeasurePerformance] public ActionResult Index() { UiTestModel model = new UiTestModel(); model = DynamicListToDataTable(); Debug.WriteLine("call a webservice from gfbio"); return(View(model)); }
//[RecordCall] //[LogExceptions] //[Diagnose] //[MeasurePerformance] private UiTestModel DynamicListToDataTable() { DataStructureManager dm = new DataStructureManager(); UiTestModel model = new UiTestModel(); model.DataTable = BexisDataHelper.ToDataTable <DataStructure>(dm.AllTypesDataStructureRepo.Get(), new List <string> { "Id", "Name", "Description", "CreationInfo" }); model.DataTable2 = model.DataTable; return(model); }
public ActionResult XSDtest() { string pathXsd = "G:/schema.xsd"; string pathXml = "G:/test.xml"; XmlSchema Schema; try { XmlDocument doc = new XmlDocument(); if (FileHelper.FileExist("pathXml")) { FileHelper.Delete(pathXml); } XmlNode root = doc.CreateElement("xyz"); XmlAttribute rootAttr = doc.CreateAttribute("xmlns"); rootAttr.Value = "abc"; if (root.Attributes != null) { root.Attributes.Append(rootAttr); } XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "utf-8", null); doc.AppendChild(declaration); doc.AppendChild(root); doc.Save(pathXml); } catch (Exception ex) { Console.WriteLine(ex.Message); } UiTestModel model = new UiTestModel(); return(View("Index", model)); }
public ActionResult Test() { UiTestModel model = new UiTestModel(); model = DynamicListToDataTable(); //SubmissionManager pm = new SubmissionManager(); //DatasetManager dm = new DatasetManager(); //pm.Load(); //DataRepository gfbio = pm.DataRepositories.Where(d => d.Name.ToLower().Equals("gfbio")).FirstOrDefault(); //// get metadata //long testdatasetId = 1; //string formatname = ""; //XmlDocument newXmlDoc; //DatasetVersion dsv = dm.GetDatasetLatestVersion(testdatasetId); //string title = XmlDatasetHelper.GetInformation(dsv, NameAttributeValues.title); //if (gfbio != null) //{ // formatname = // XmlDatasetHelper.GetAllTransmissionInformation(1, TransmissionType.mappingFileExport, AttributeNames.name) // .First(); // OutputMetadataManager.GetConvertedMetadata(testdatasetId, TransmissionType.mappingFileExport, // formatname); // // get primary data // // check the data sturcture type ... // if (dsv.Dataset.DataStructure.Self is StructuredDataStructure) // { // OutputDataManager odm = new OutputDataManager(); // // apply selection and projection // odm.GenerateAsciiFile(testdatasetId, title, gfbio.PrimaryDataFormat); // } // string zipName = pm.GetZipFileName(testdatasetId, dsv.Id); // string zipPath = pm.GetDirectoryPath(testdatasetId, gfbio); // string zipFilePath = Path.Combine(zipPath, zipName); // FileHelper.CreateDicrectoriesIfNotExist(Path.GetDirectoryName(zipFilePath)); // if (FileHelper.FileExist(zipFilePath)) // { // if (FileHelper.WaitForFile(zipFilePath)) // { // FileHelper.Delete(zipFilePath); // } // } // ZipFile zip = new ZipFile(); // foreach (ContentDescriptor cd in dsv.ContentDescriptors) // { // string path = Path.Combine(AppConfiguration.DataPath, cd.URI); // string name = cd.URI.Split('\\').Last(); // if (FileHelper.FileExist(path)) // { // zip.AddFile(path, ""); // } // } // zip.Save(zipFilePath); //} //else //{ // newXmlDoc = dsv.Metadata; //} return(View("Index", model)); }
public ActionResult sendForm(UiTestModel model) { return(View("Index", model)); }