private static string connectionString = @"User Id=****;Password=****;Host=****;Database=****;Persist Security Info=True";
public MySqlConnection Connection = null;
public MySqlTransaction Transaction = null;
private MySqlCommand Command = null;
public LinqDataContext(string p_ConnectionString = "")
{
if (string.IsNullOrWhiteSpace(p_ConnectionString) == false)
{
connectionString = p_ConnectionString;
}
Connection = new MySqlConnection(connectionString);
}
public int InsertPayee(System.Nullable<int> p_StoreID, System.Nullable<int> p_PayeeID, string p_PayeeName, string p_StreetAddress, string p_City, System.Nullable<int> p_StateID, string p_ZipCode, string p_PhoneNumber, string p_EmailAddress, string p_Notes, System.Nullable<int> p_CarrierID, System.Nullable<bool> p_IsActive, System.Nullable<int> p_RegisterID)
{
using (Connection)
{
if (Connection.State != ConnectionState.Open)
{
Connection.Open();
}
Command = new MySqlCommand("InsertPayee", Connection);
Command.CommandType = CommandType.StoredProcedure;
if (Transaction != null)
{
Command.Transaction = Transaction;
}
Command.Parameters.Add(new MySqlParameter("p_StoreID", p_StoreID));
Command.Parameters.Add(new MySqlParameter("p_PayeeID", p_PayeeID));
Command.Parameters.Add(new MySqlParameter("p_PayeeName", p_PayeeName));
Command.Parameters.Add(new MySqlParameter("p_StreetAddress", p_StreetAddress));
Command.Parameters.Add(new MySqlParameter("p_City", p_City));
Command.Parameters.Add(new MySqlParameter("p_StateID", p_StateID));
Command.Parameters.Add(new MySqlParameter("p_ZipCode", p_ZipCode));
Command.Parameters.Add(new MySqlParameter("p_PhoneNumber", p_PhoneNumber));
Command.Parameters.Add(new MySqlParameter("p_EmailAddress", p_EmailAddress));
Command.Parameters.Add(new MySqlParameter("p_Notes", p_Notes));
Command.Parameters.Add(new MySqlParameter("p_CarrierID", p_CarrierID));
Command.Parameters.Add(new MySqlParameter("p_IsActive", p_IsActive));
Command.Parameters.Add(new MySqlParameter("p_RegisterID", p_RegisterID));
return Command.ExecuteNonQuery();
}
}