예제 #1
0
파일: UserEnter.cs 프로젝트: Amarg0/C-
 public UserEnter(object userbase)
 {
     InitializeComponent();
     LoginTextbox.Text = Resources.Логин_;
     PasswordTextbox.Text = Resources.Пароль_;
     userBase = (UserBase) userbase;
 }
예제 #2
0
 public RegistrationForm(object users)
 {
     InitializeComponent();
     LoginTextbox.Text = Resources.RegistrationForm_RegistrationForm_Введите_логин_;
     PasswordTextbox.Text = Resources.RegistrationForm_RegistrationForm_Введите_пароль_;
     Password2Textbox.Text = Resources.RegistrationForm_RegistrationForm_Повторите_пароль_;
     userBase = (UserBase) users;
 }
예제 #3
0
파일: Program.cs 프로젝트: Amarg0/C-
        static void Main()
        {
            UserBase userBase = new UserBase();
            object userso = userBase;
            int problemCounter;
            List<Problem> problems = new List<Problem>();
            int UserCounter;
            List<User> users = new List<User>();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());
            Application.Run(new Logon(userso));
        }
예제 #4
0
파일: BussinessLayer.cs 프로젝트: Amarg0/C-
        public bool Enter(UserBase userBase, string login, string password)
        {
            if (userBase.FileCheck())
            {
                userBase.Deserialize();
            }

            for (int i = 0; i < 100; i++)
            {
                if (userBase.Users[i]==null)
                    break;
                if (userBase.Users[i].Login == login && userBase.Users[i].Password == password)
                    return true;

            }
            throw new Exception("Не удалось выполнить вход");
        }
예제 #5
0
파일: BussinessLayer.cs 프로젝트: Amarg0/C-
        public void CreateUser(UserBase userBase, string login, string password)
        {
            if (userBase.FileCheck())
            {
                userBase.Deserialize();
            }
            for (int i=0; i < 1000; i++)
            {
                if (userBase.Users[i] == null)
                {
                    userBase.Users[i] = new User(login, password);
                    break;
                }
            }

            userBase.Serialize();
        }