CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.commerce_starter_kit Tags:
Item Type: NewsGroup Date Entered: 2/29/2004 2:59:27 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 19 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
asp.netcat
Asp.Net User
How to Modify ASP.NET Commerce Kit Register File?2/29/2004 2:59:27 AM

0/0

Would like to Modify the Commerce Kits Register Page, so that it can request additional
information. I modified and adjusted the CMRC_ CustomerAdd, & also the CMRC_Customer Details stored procedures. And I adjusted the CustomersDB.cs file. listed also below, but I get an error message when I try to compile a new ASPNETCommerce.dll. Don't know what I'm missing/overlooking. I've only added 1 Item to the orininal CustomersDB.cs file, and that is the "FirstName' . I would like to add additional names later, but for now I just want to be able to modify it with just one Item. But I'm over looking something. If anyone can Help, That would be most welcome TIA.



CustomerDB.cs<142,40>: error CS0103: The name ?FirstName? does not exist in the class or namespace ?ASPNET.StarterKit.Commerce.CustomersDB?




CREATE Procedure CMRC_CustomerAdd
(
@FullName nvarchar(50),
@Email nvarchar(50),
@Password nvarchar(50),
@FirstName nvarchar(50),
@CustomerID int OUTPUT
)
AS

INSERT INTO CMRC_Customers
(
FullName,
EmailAddress,
Password,
FirstName
)

VALUES
(
@FullName,
@Email,
@Password,
@FirstName
)

SELECT
@CustomerID = @@Identity
GO




CREATE Procedure CMRC_CustomerDetail
(
@CustomerID int,
@FullName nvarchar(50) OUTPUT,
@Email nvarchar(50) OUTPUT,
@Password nvarchar(50) OUTPUT,
@FirstName nvarchar(50) OUTPUT
)
AS

SELECT
@FullName = FullName,
@Email = EmailAddress,
@Password = Password,
@FirstName = FirstName

FROM
CMRC_Customers

WHERE
CustomerID = @CustomerID
GO



using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

namespace ASPNET.StarterKit.Commerce {

//*******************************************************
//
// CustomerDetails Class
//
// A simple data class that encapsulates details about
// a particular customer inside the Commerce Customer
// database.
//
//*******************************************************

public class CustomerDetails {

public String FullName;
public String Email;
public String Password;
public String FirstName;
}

//*******************************************************
//
// CustomersDB Class
//
// Business/Data Logic Class that encapsulates all data
// logic necessary to add/login/query customers within
// the Commerce Customer database.
//
//*******************************************************

public class CustomersDB {





//*******************************************************
//
// CustomersDB.GetCustomerDetails() Method <a name="GetCustomerDetails"></a>
//
// The GetCustomerDetails method returns a CustomerDetails
// struct that contains information about a specific
// customer (name, email, password, etc).
//
// Other relevant sources:
// + CustomerDetail Stored Procedure
//
//*******************************************************

public CustomerDetails GetCustomerDetails(String customerID)
{

// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand myCommand = new SqlCommand("CMRC_CustomerDetail", myConnection);

// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;

// Add Parameters to SPROC
SqlParameter parameterCustomerID = new SqlParameter("@CustomerID", SqlDbType.Int, 4);
parameterCustomerID.Value = Int32.Parse(customerID);
myCommand.Parameters.Add(parameterCustomerID);

SqlParameter parameterFullName = new SqlParameter("@FullName", SqlDbType.NVarChar, 50);
parameterFullName.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterFullName);

SqlParameter parameterEmail = new SqlParameter("@Email", SqlDbType.NVarChar, 50);
parameterEmail.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterEmail);

SqlParameter parameterPassword = new SqlParameter("@Password", SqlDbType.NVarChar, 50);
parameterPassword.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterPassword);

SqlParameter parameterFirstName = new SqlParameter("@FirstName", SqlDbType.NVarChar, 50);
parameterFirstName.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterFirstName);

myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();

// Create CustomerDetails Struct
CustomerDetails myCustomerDetails = new CustomerDetails();

// Populate Struct using Output Params from SPROC
myCustomerDetails.FullName = (string)parameterFullName.Value;
myCustomerDetails.Password = (string)parameterPassword.Value;
myCustomerDetails.Email = (string)parameterEmail.Value;
myCustomerDetails.FirstName = (string)parameterFirstName.Value;


return myCustomerDetails;
}

//*******************************************************
//
// CustomersDB.AddCustomer() Method <a name="AddCustomer"></a>
//
// The AddCustomer method inserts a new customer record
// into the customers database. A unique "CustomerId"
// key is then returned from the method. This can be
// used later to place orders, track shopping carts,
// etc within the ecommerce system.
//
// Other relevant sources:
// + CustomerAdd Stored Procedure
//
//*******************************************************

public String AddCustomer(string fullName, string email, string password, string firstname)
{

// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand myCommand = new SqlCommand("CMRC_CustomerAdd", myConnection);

// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;

// Add Parameters to SPROC
SqlParameter parameterFullName = new SqlParameter("@FullName", SqlDbType.NVarChar, 50);
parameterFullName.Value = fullName;
myCommand.Parameters.Add(parameterFullName);

SqlParameter parameterEmail = new SqlParameter("@Email", SqlDbType.NVarChar, 50);
parameterEmail.Value = email;
myCommand.Parameters.Add(parameterEmail);

SqlParameter parameterPassword = new SqlParameter("@Password", SqlDbType.NVarChar, 50);
parameterPassword.Value = password;
myCommand.Parameters.Add(parameterPassword);

SqlParameter parameterFirstName = new SqlParameter("@FirstName", SqlDbType.NVarChar, 50);
parameterFirstName.Value = FirstName;
myCommand.Parameters.Add(parameterFirstName);

SqlParameter parameterCustomerID = new SqlParameter("@CustomerID", SqlDbType.Int, 4);
parameterCustomerID.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterCustomerID);

try {
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();

// Calculate the CustomerID using Output Param from SPROC
int customerId = (int)parameterCustomerID.Value;

return customerId.ToString();
}
catch {
return String.Empty;
}
}

//*******************************************************
//
// CustomersDB.Login() Method <a name="Login"></a>
//
// The Login method validates a email/password pair
// against credentials stored in the customers database.
// If the email/password pair is valid, the method returns
// the "CustomerId" number of the customer. Otherwise
// it will throw an exception.
//
// Other relevant sources:
// + CustomerLogin Stored Procedure
//
//*******************************************************

public String Login(string email, string password)
{

// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand myCommand = new SqlCommand("CMRC_CustomerLogin", myConnection);

// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;

// Add Parameters to SPROC
SqlParameter parameterEmail = new SqlParameter("@Email", SqlDbType.NVarChar, 50);
parameterEmail.Value = email;
myCommand.Parameters.Add(parameterEmail);

SqlParameter parameterPassword = new SqlParameter("@Password", SqlDbType.NVarChar, 50);
parameterPassword.Value = password;
myCommand.Parameters.Add(parameterPassword);

SqlParameter parameterCustomerID = new SqlParameter("@CustomerID", SqlDbType.Int, 4);
parameterCustomerID.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterCustomerID);

// Open the connection and execute the Command
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();

int customerId = (int)(parameterCustomerID.Value);

if (customerId == 0) {
return null;
}
else {
return customerId.ToString();
}
}
}
}

1 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Etienne's Tech Blog: How to get the ASP.NET Commerce Starter Kit ... How to get the ASP.NET Commerce Starter Kit 2.0 to run in medium trust ! .... BTW: your code can be used a real commerce website? what I should modify if I ...
IBuySpy Store and Commerce Starter Kit Admin Tool IBuySpy Store and Commerce Starter Kit Admin Tool with C# and ASP.NET. ... following specific parse error details and modify your source file appropriately . ...
ASP.NET: Jump Start Your Web Site Development with the ASP.NET ... The ASP.NET Starter Kits are packaged solutions that let you do just that. The five kits—Community, Reports, Commerce, Portal, and Time Tracker—supply full, ...
Leveraging the Starter Kits in Your ASP.NET Development NET Starter Kits\ASP.NET Commerce (VBVS)\CommerceVBVS. Select Web files in .... to the ContentSkins folder of the Arc theme and modify the new ASCX file. ...
Awesome ASP.NET 2.0 RSS Tool-Kit Released - ScottGu's Blog re: Awesome ASP.NET 2.0 RSS Tool-Kit Released. Friday, August 18, 2006 5:03 PM by ScottGu. Hi Mikael,. Can you send me a sample .zip file over email to look ...
King's Blog - Commerce Starter Kit 2.0 - Payment Provider ... NET Info about 1and1 hosting for beginners - ASP.NET Forums I am trying to set up the commerce starter kit on 1and1 and I'm having the .... I used PAINTDOTNET to modify all the .jpg and .gif files. ...
IBuySpy Store White Paper ASP.NET Commerce Starter Kit: Design and Implementation .... If you modify any of the component source files, you will need to recompile them to update the ...
DevASP.Net Personal Web Site Starter Kit Register with the web site. * Post their resume. * Modify their resume. .... E- commerce starter kit is an ASP.NET 2.0 application that represents a typical ...
CodeProject: Converting an ASP.NET site into a SharePoint site ... Register the assemblies that will be used in the SharePoint site (web ..... Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP. ...




Search This Site:










iis directory set as application

change iframe content when clicking on an <asp:menu> item

webparts and anonymous access.

what is this cs1595: error?

access provider

asp.net 1.1

change in the text/html module

file read/write and syncronization

extending the treeview control

good asp.net (vb) object oriented book

html format

can it be done? mixed authentication mode

newbie.. please guide, dotnetnuke

cannot find system.web section

file manage issue(as well as pic uploading in gallery) in 3.0.13

how can i setting profile properties for others

to modify the noun of the dotnetnuke.all project?

asp.net capturing usb port events in both windows and linux

unit testing in asp.net

asp:panel control & visible property

sql query using powerreports is wrong -- help please

deploying to isp

sitemap page

.text file read into sql database? is this the right direction?

login page issues

switch statement less than ? more than ?

concatenating dbconnection string...how?

authorization problem

newbie unable to get personal website poject going on dotster

creating email server

 
All Times Are GMT