コード例 #1
0
        public void InsertUser(string userName, string password, out bool status, out string errorMessage)
        {
            UserModel user = new UserModel();

            status       = false;
            errorMessage = "OK";

            DALogin   daLogin   = new DALogin();
            DataTable dataTable = daLogin.CheckUsers(userName);

            if (dataTable.Rows.Count == 1)
            {
                status       = true;
                errorMessage = "Utilizator existent";
            }
            else
            {
                daLogin.InsertUser(userName, Base64Encode(password));
                DataTable dataTable2 = daLogin.CheckUsers(userName);

                if (dataTable2.Rows.Count == 1)
                {
                    status       = false;
                    errorMessage = "Utilizator adaugat!";
                }
            }
        }