Code: Select all
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.SqlClient;
using System.Data;
Code: Select all
//FireFold - custom methods
public static int StoreStockNotificationEmailId(int ProductId, string EmailId)
{
//have to check first... to avoid duplicates.
Database database = Token.Instance.Database;
ParameterCollection parameterColl = new ParameterCollection();
string sqlQuery = "Insert into custom_StockNotify (ProductId, EmailId) values (@ProductId, @EmailId)";
int rowsAffected = 0;
{
//using (System.Data.Common.DbCommand selectCommand = database.GetSqlStringCommand(sqlQuery))
using (System.Data.Common.DbCommand selectCommand = database.GetStoredProcCommand("sp_AddStockEmailId"))
{
database.AddInParameter(selectCommand, "@ProductId", System.Data.DbType.Int32, ProductId);
database.AddInParameter(selectCommand, "@EmailId", System.Data.DbType.String, EmailId);
database.AddOutParameter(selectCommand, "@returnVal", System.Data.DbType.Int32, 0);
database.ExecuteNonQuery(selectCommand);
rowsAffected = int.Parse(database.GetParameterValue(selectCommand, "@returnVal").ToString());
}
}
return rowsAffected;
}
Code: Select all
//FireFold Mod: For Stock email Notification
protected void StockEmailSubmit_Click(object sender, System.EventArgs e)
{
int result = ProductHelper.StoreStockNotificationEmailId(_ProductId, StockEmail.Text);
if (result > 0)
{
lblResult.Text = "E-Mail Accepted. Watch Your Inbox For Our E-Mail!";
}
}
CS0234: The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Any ideas?