Пример #1
0
        public void CreateUser()
        {
            string rep = AskQuestion(definitions.FormTitle.AddUser, definitions.Question.AddUser);

            if (rep != "")
            {
                bool          bFirst = false;
                File.textlist f      = ObtaintUserTextList();
                if (f.IsExist(rep))
                {
                    MessageBox.Show(definitions.Message.UserExist);
                    return;
                }
                if (!LoadCurrentUser())
                {
                    bFirst = true;
                }
                f.Items.Add(rep);
                f.Sort();
                f.WriteList();
                Object.User u = new User(rep);
                u.CreateUser();

                if (bFirst)
                {
                    SetCurrentUser(rep, true);
                }
                UpdateAllUserScript();
            }
        }
Пример #2
0
 public void addValue(string val)
 {
     foreach (string s in mFile.Items)
     {
         if (s == val)
         {
             return;
         }
     }
     mFile.Items.Add(val);
     mFile.Sort();
     RefreshListBox();
 }