Example #1
0
 public static void LoadCheckList(List <string> dirs)
 {
     checkLists.Clear();
     foreach (string item in dirs)
     {
         var jsonCryp = File.ReadAllText(@"CheckList\\" + item);
         if (isCrypto)
         {
             jsonCryp = Sini4ka.Landing(jsonCryp, "синяя синичка");
         }
         CheckListClass tmp = JsonConvert.DeserializeObject <CheckListClass>(jsonCryp);
         checkLists.Add(tmp);
     }
 }
Example #2
0
        public static void SaveResult(string mark, bool isTest)
        {
            String sourcePath;

            try
            {
                StreamReader sr  = new StreamReader("ServerPath.txt");
                string       srs = sr.ReadLine();
                sourcePath = srs + "\\Results\\" + "Marks.marks";
                sr.Close();
                if (!Directory.Exists(srs + @"\\Results"))
                {
                    Directory.CreateDirectory(srs + @"\\Results");
                }
                Result result = new Result(session.Subject.Name, session.CheckList.Inform.Name,
                                           session.Platoon.PlatNum.ToString(), session.Student.Fio, mark, isTest, DateTime.Now);

                string data = JsonConvert.SerializeObject(result);
                if (isCrypto)
                {
                    if (File.Exists(sourcePath))
                    {
                        string buffer  = File.ReadAllText(sourcePath);
                        string uncript = Sini4ka.Landing(buffer, "синяя синичка");
                        data = (uncript += "#" + data);
                    }
                    string cryptoS = Sini4ka.Flying(data, "синяя синичка");
                    File.WriteAllText(sourcePath, cryptoS);
                }
                else
                {
                    File.WriteAllText(sourcePath, data);
                }
            }
            catch (Exception e)
            {
            }
        }