Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…5-Website-Project

Conflicts:
	StudentAlumniTrackingTool/StudentAlumniTrackingTool.suo
  • Loading branch information
jjmurray383 committed Apr 8, 2012
1 parent 5fdbb25 commit 7fcf74b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
</p>
</fieldset>
<p class="submitButton">
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup"/>
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In"
ValidationGroup="LoginUserValidationGroup" onclick="LoginButton_Click"/>
</p>
</div>
</LayoutTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ protected void Page_Load(object sender, EventArgs e)
{
RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
}

protected void LoginButton_Click(object sender, EventArgs e)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@
</fieldset>
<p class="submitButton">
<asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User"
ValidationGroup="RegisterUserValidationGroup" />
ValidationGroup="RegisterUserValidationGroup"
onclick="CreateUserButton_Click" />
</p>
</div>
</ContentTemplate>
Expand All @@ -513,11 +514,11 @@
<asp:WizardStep ID="VerifyUser" runat="server">

</asp:WizardStep>
<asp:CompleteWizardStep runat = "server">
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat = "server">
<ContentTemplate>
<h2>Account Created!</h2>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</asp:Content>
</asp:Content>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
Expand Down Expand Up @@ -41,33 +42,36 @@ protected void AddMember(object sender, EventArgs e)

protected void RegisterUser_CreatedUser(object sender, EventArgs e)
{
FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);

}

protected void CreateUserButton_Click(object sender, EventArgs e)
{
FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
string connectionString = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
string continueUrl = RegisterUser.ContinueDestinationPageUrl;
if (String.IsNullOrEmpty(continueUrl))
{
continueUrl = "~/";
}
Response.Redirect(continueUrl);
//Response.Redirect(continueUrl);

// First verify that this user is unique; do this by finding the email and checking against DB
TextBox EmailTextBox = (TextBox)RegisterUserWizardStep.ContentTemplateContainer.FindControl("Email");
string connectionString = "";
SqlConnection DBConn = new SqlConnection(connectionString);
SqlCommand DBCmd = new SqlCommand();
SqlCommand sqlComm = new SqlCommand();

try
{
DBConn.Open();
// Add SQL statement to insert into database
DBCmd = new SqlCommand(
"INSERT INTO STUDENT(Email, Fname, Lname)" +
"VALUES (@UID, @Email, @Fname, @Lname)", DBConn);

// Add database parameters
// DBCmd.Parameters.Add("@UID", System.Data.SqlDbType.Int).Value = newUserId;
DBCmd.Parameters.Add("@Email", System.Data.SqlDbType.VarChar).Value = EmailTextBox.Text;
DBCmd.ExecuteNonQuery();
}

catch (Exception exp)
Expand All @@ -80,26 +84,6 @@ protected void RegisterUser_CreatedUser(object sender, EventArgs e)
TextBox LastNameTextBox = (TextBox)RegisterUserWizardStep.ContentTemplateContainer.FindControl("LastName");
TextBox UsernameTextBox = (TextBox)RegisterUserWizardStep.ContentTemplateContainer.FindControl("UserName");



try
{
// Add SQL statement to insert into database
DBCmd = new SqlCommand(
"INSERT ");

// Add database parameters
// DBCmd.Parameters.Add("@UID", System.Data.SqlDbType.Int).Value = newUserId;
DBCmd.Parameters.Add("@Email", System.Data.SqlDbType.VarChar).Value = EmailTextBox.Text;
DBCmd.Parameters.Add("@Fname", System.Data.SqlDbType.VarChar).Value = FirstNameTextBox.Text;
DBCmd.Parameters.Add("@Lname", System.Data.SqlDbType.VarChar).Value = LastNameTextBox.Text;
DBCmd.ExecuteNonQuery();
}

catch (Exception exp)
{
Response.Write(exp);
}

// Close database connection and dispose database objects
DBCmd.Dispose();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
<Content Include="Scripts\jquery-1.4.1-vsdoc.js" />
<Content Include="Scripts\jquery-1.4.1.js" />
<Content Include="Scripts\jquery-1.4.1.min.js" />
<Content Include="Web.config" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=192.168.2.20; Initial Catalog = VSTest; User ID=testSQL;Pwd=12345678"
connectionString="Data Source=WINDBTESTENVIRON; Initial Catalog=VSTest; Integrated Security=False; User ID=testSQL;Password=12345678;"
providerName="System.Data.SqlClient" />
</connectionStrings>

Expand Down

0 comments on commit 7fcf74b

Please sign in to comment.