Exemplo n.º 1
0
 public IActionResult Get(SampleDatas analyzerFilterData)
 {
     //var data = new NetworkTrafficApiQueryString(analyzerFilterData);
     //var analyzerRecords = new FetchDataFromExternalApi(_glassClient, _iConfiguration);
     //var response = analyzerRecords.Call(data, CurrentUser.CompanyUrn);
     return(Ok());
 }
        private void DataSearch()
        {
            DataSet ds = new DataSet();

            string query = @"
SELECT '범범조조' AS NAME, '28' AS AGE, '4' AS GRADE, '90' AS SCORE
UNION ALL
SELECT '안정환' AS NAME, '26' AS AGE, '4' AS GRADE, '80' AS SCORE
UNION ALL
SELECT '김성주' AS NAME, '36' AS AGE, '4' AS GRADE, '87' AS SCORE
UNION ALL
SELECT '정형돈' AS NAME, '46' AS AGE, '3' AS GRADE, '40' AS SCORE
UNION ALL
SELECT '아이유' AS NAME, '26' AS AGE, '2' AS GRADE, '62' AS SCORE
UNION ALL
SELECT '이기자' AS NAME, '22' AS AGE, '1' AS GRADE, '100' AS SCORE
";

            SqlDBManager.Instance.ExecuteDsQuery(ds, query);

            for (int idx = 0; idx < ds.Tables[0].Rows.Count; idx++)
            {
                Student obj = new Student();
                obj.NAME  = ds.Tables[0].Rows[idx]["NAME"].ToString();
                obj.AGE   = ds.Tables[0].Rows[idx]["AGE"].ToString();
                obj.GRADE = ds.Tables[0].Rows[idx]["GRADE"].ToString();
                obj.SCORE = ds.Tables[0].Rows[idx]["SCORE"].ToString();

                SampleDatas.Add(obj);
            }
        }
Exemplo n.º 3
0
        public static void ExoIO01()  //Sérialiser et désérialiser une liste de personnes dans un fichier
        {
            using (var stream = new FileStream("personne.xml", FileMode.OpenOrCreate, FileAccess.Write))
            {
                var xmlSerializer = new XmlSerializer(typeof(List <Personne>));
                xmlSerializer.Serialize(stream, SampleDatas.GetSamplePersonnes());
            }

            using (var stream = new FileStream("personne.xml", FileMode.Open, FileAccess.Read))
            {
                var xmlSerializer = new XmlSerializer(typeof(List <Personne>));
                var personnes     = xmlSerializer.Deserialize(stream) as List <Personne>;

                foreach (var p in personnes)
                {
                    WriteLine(p);
                }
            }
        }
Exemplo n.º 4
0
 private void Initialize(List <SampleData> ParticularData, List <JudgeUser> ParticularUser)
 {
     judgers.Clear();
     CancelTasksDelegate.Clear();
     JudgeUsers.Where(j => ParticularUser.Contains(j)).AsQueryable().ToList().ForEach(u => { u.Reports.Clear(); });
     JudgeUsers.Where(j => ParticularUser.Contains(j)).AsQueryable().ToList().ForEach((u) =>
     {
         u.Units.Where(j => ParticularData.Contains(SampleDatas.SingleOrDefault(s => s.Id == j.Id))).AsQueryable().ToList().ForEach((n) =>
         {
             var j      = new Judger();
             j.Data     = SampleDatas.Single(s => s.Id == n.Id);
             j.Unit     = n;
             j.OnJudged = (sender, e) => { OnCompleteAny(); };
             var report = new UserReport()
             {
                 Data = j.Data, Results = j.Results
             };
             u.Reports.Add(report);
             judgers.Add(j);
         });
     });
 }
Exemplo n.º 5
0
 public void RunByUserAndData(List <string> UserIds, List <string> DataIds)
 {
     Initialize(SampleDatas.Where(d => DataIds.Contains(d.Id)).AsQueryable().ToList(), JudgeUsers.Where(u => UserIds.Contains(u.Id)).AsQueryable().ToList());
     Run();
 }