コード例 #1
0
ファイル: ShopForm.cs プロジェクト: oleh111/Registration
        private void Buy(int i)
        {
            GameFormController gfcntrl   = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult       dlgResult = gfcntrl.Run(this);

            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                initializeTabPage2();
            }
        }
コード例 #2
0
        private void Buy(int i)
        {
            GameFormController gfcntrl   = new GameFormController(glibr.Get(i), user, t1[i], t2[i], t3[i]);
            DialogResult       dlgResult = gfcntrl.Run(this);

            if (dlgResult == DialogResult.OK)
            {
                user.Glib.Add(glibr.Get(i));
                libr.Set(user);
                System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                File.WriteAllText(@"E:\Registration\Registration\Registration\DataBase.json", "");
                for (int j = 0; j < libr.size(); j++)
                {
                    string sJSON = oSerializer.Serialize(libr.getByIndex(j));
                    sJSON += "\n";
                    File.AppendAllText(@"E:\Registration\Registration\Registration\DataBase.json", sJSON);
                }
                initializeTabPage2();
            }
        }
コード例 #3
0
 public void libraryTest2Set()
 {
     Library l;
     l = new Library();
     l.Add(new Person("1", "2", "3", "4"));
     l.Set(new Person("1", "22", "33", "44"));
     if (l.GetPassword(0) != "22")
     {
         Assert.Fail();
     }
 }