Esempio n. 1
2
        public int addNewUser(string firstname, string lastname, string companyname, string email, string password, string countryid, string stateid, string mobile, int type, string verify)
        {
            int status = 0;
            try
            {
                Guid guid = Guid.NewGuid();
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "InsertUser";
                objDB.AddInParameter(objAdd, "@FName", DbType.String, firstname);
                objDB.AddInParameter(objAdd, "@LName", DbType.String, lastname);
                objDB.AddInParameter(objAdd, "@Companyname", DbType.String, companyname);
                objDB.AddInParameter(objAdd, "@Email", DbType.String, email);
                objDB.AddInParameter(objAdd, "@Password", DbType.String, password);
                objDB.AddInParameter(objAdd, "@Countryid", DbType.Int32, countryid);
                objDB.AddInParameter(objAdd, "@Stateid", DbType.Int32, stateid);
                objDB.AddInParameter(objAdd, "@Mobile", DbType.String, mobile);
                objDB.AddInParameter(objAdd, "@Type", DbType.Int32, type);
                objDB.AddInParameter(objAdd, "@Verify", DbType.String, verify);
                objDB.AddOutParameter(objAdd, "@Stat", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Stat"));

                return status;
            }
            catch (Exception ex)
            {
                objErr.GeneralExceptionHandling(ex, "Website - User Registration", "addNewUser", "GENERAL EXCEPTION");
                return status;
            }
        }
Esempio n. 2
0
        public int addNewProductPost(string userid, int l1id, int l2id, int l3id, string productname, string keywords, string description, decimal quantity, decimal price, string image1,
            string image2, string image3, string image4)
        {
            int status = 0;
            try
            {

                Guid guid = new Guid(userid);
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "InsertProductPost";
                objDB.AddInParameter(objAdd, "@USERID", DbType.Guid, guid);
                objDB.AddInParameter(objAdd, "@L1ID", DbType.Int32, l1id);
                objDB.AddInParameter(objAdd, "@L2ID", DbType.Int32, l2id);
                objDB.AddInParameter(objAdd, "@L3ID", DbType.Int32, l3id);
                objDB.AddInParameter(objAdd, "@PRODUCTNAME", DbType.String, productname);
                objDB.AddInParameter(objAdd, "@DESCRIPTION", DbType.String, description);
                objDB.AddInParameter(objAdd, "@QUANTITY", DbType.Decimal, quantity);
                objDB.AddInParameter(objAdd, "@PRICE", DbType.Decimal, price);
                objDB.AddInParameter(objAdd, "@KEYWORDS", DbType.String, keywords);
                objDB.AddInParameter(objAdd, "@IMAGE1", DbType.String, image1);
                objDB.AddInParameter(objAdd, "@IMAGE2", DbType.String, image2);
                objDB.AddInParameter(objAdd, "@IMAGE3", DbType.String, image3);
                objDB.AddInParameter(objAdd, "@IMAGE4", DbType.String, image4);
                objDB.AddOutParameter(objAdd, "@Stat", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Stat"));
            }
            catch (Exception ex)
            {
                objErr.GeneralExceptionHandling(ex, "Website - Post Product", "addNewProductPost", "GENERAL EXCEPTION");
            }
            return status;
        }
Esempio n. 3
0
        public int addInquiry(string name, string email, string subject, string message)
        {
            int status = 0;
            try
            {
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "InsertInquiry";
                objDB.AddInParameter(objAdd, "@Name", DbType.String, name);
                objDB.AddInParameter(objAdd, "@Email", DbType.String, email);
                objDB.AddInParameter(objAdd, "@Subject", DbType.String, subject);
                objDB.AddInParameter(objAdd, "@Message", DbType.String, message);
                objDB.AddOutParameter(objAdd, "@Stat", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Stat"));

                return status;
            }
            catch (Exception ex)
            {
                objCommom.LogFile("Contact.aspx", "addInquiry", ex);
                return status;
            }
        }
Esempio n. 4
0
        public int UpdateMailer(int Id)
        {
            int status = 0;
            try
            {
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "UpdateClientbyId";
                objDB.AddInParameter(objAdd, "@Id", DbType.Int32, Id);
                objDB.AddOutParameter(objAdd, "@Status", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Status"));

                return status;
            }
            catch (Exception ex)
            {
                throw ex;
                return status;
            }
        }
        public int addSentMail(string strType, string strActive, string strEmailID)
        {
            try
            {
                int status;

                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "PS_add_SentMailLog";
                objDB.AddInParameter(objAdd, "@Type", DbType.String, strType);
                objDB.AddInParameter(objAdd, "@Active", DbType.String, strActive);
                objDB.AddInParameter(objAdd, "@EmailID", DbType.String, strEmailID);
                objDB.AddOutParameter(objAdd, "@Status", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Status"));
                return status;
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                throw ex;
            }
        }
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.TimestampPk object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.TimestampPk object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.TimestampPk object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.TimestampPk entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Test.usp_adwTiers_TimestampPK_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@TimestampPk", DbType.Binary, 8);
			database.AddInParameter(commandWrapper, "@SomeText", DbType.AnsiString, entity.SomeText );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _timestampPk = database.GetParameterValue(commandWrapper, "@TimestampPk");
			entity.TimestampPk = (System.Byte[])_timestampPk;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Update an existing row in the datasource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.TimestampPk object to update.</param>
		/// <remarks>
		///		After updating the datasource, the Nettiers.AdventureWorks.Entities.TimestampPk object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
        /// <exception cref="DBConcurrencyException">The record has been modified by an other user. Please reload the instance before updating.</exception>
		public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.TimestampPk entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Test.usp_adwTiers_TimestampPK_Update", _useStoredProcedure);
			
			database.AddInParameter(commandWrapper, "@TimestampPk", DbType.Binary, entity.TimestampPk );
			database.AddInParameter(commandWrapper, "@SomeText", DbType.AnsiString, entity.SomeText );
			database.AddOutParameter(commandWrapper, "@ReturnedTimestampPk", DbType.Binary, 8);
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Update", entity));

			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
			
			//Stop Tracking Now that it has been updated and persisted.
			if (DataRepository.Provider.EnableEntityTracking)
				EntityManager.StopTracking(entity.EntityTrackingKey);
			
			if (results == 0)
			{
				throw new DBConcurrencyException("Concurrency exception");
			}
			entity.TimestampPk = (System.Byte[])database.GetParameterValue(commandWrapper, "@ReturnedTimestampPk");
			
			entity.AcceptChanges();
			
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Update", entity));

			return Convert.ToBoolean(results);
		}
		/// <summary>
		/// 	Inserts a HearbalKartDB.Entities.States object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">HearbalKartDB.Entities.States object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the HearbalKartDB.Entities.States object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, HearbalKartDB.Entities.States entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.States_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@Id", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@CountryId", DbType.Int32, (entity.CountryId.HasValue ? (object) entity.CountryId  : System.DBNull.Value));
            database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
			database.AddInParameter(commandWrapper, "@Pin", DbType.Int64, (entity.Pin.HasValue ? (object) entity.Pin  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@IsActive", DbType.Boolean, (entity.IsActive.HasValue ? (object) entity.IsActive  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@CreatedDate", DbType.DateTime, (entity.CreatedDate.HasValue ? (object) entity.CreatedDate  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, (entity.ModifiedDate.HasValue ? (object) entity.ModifiedDate  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@DeletedDate", DbType.DateTime, (entity.DeletedDate.HasValue ? (object) entity.DeletedDate  : System.DBNull.Value));
            database.AddInParameter(commandWrapper, "@PinCode", DbType.String, entity.PinCode );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _id = database.GetParameterValue(commandWrapper, "@Id");
			entity.Id = (System.Int32)_id;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
        /// <summary>
        /// 	Inserts a Northwind.Entities.Employees object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Northwind.Entities.Employees object to insert.</param>
        /// <remarks>
        ///		After inserting into the datasource, the Northwind.Entities.Employees object will be updated
        /// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
        /// </remarks>	
        /// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
        public override bool Insert(TransactionManager transactionManager, Northwind.Entities.Employees entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.sp_nt_Employees_Insert", _useStoredProcedure);

            database.AddOutParameter(commandWrapper, "@EmployeeId", DbType.Int32, 4);
            database.AddInParameter(commandWrapper, "@LastName", DbType.String, entity.LastName );
            database.AddInParameter(commandWrapper, "@FirstName", DbType.String, entity.FirstName );
            database.AddInParameter(commandWrapper, "@Title", DbType.String, entity.Title );
            database.AddInParameter(commandWrapper, "@TitleOfCourtesy", DbType.String, entity.TitleOfCourtesy );
            database.AddInParameter(commandWrapper, "@BirthDate", DbType.DateTime, (entity.BirthDate.HasValue ? (object) entity.BirthDate  : System.DBNull.Value));
            database.AddInParameter(commandWrapper, "@HireDate", DbType.DateTime, (entity.HireDate.HasValue ? (object) entity.HireDate  : System.DBNull.Value));
            database.AddInParameter(commandWrapper, "@Address", DbType.String, entity.Address );
            database.AddInParameter(commandWrapper, "@City", DbType.String, entity.City );
            database.AddInParameter(commandWrapper, "@Region", DbType.String, entity.Region );
            database.AddInParameter(commandWrapper, "@PostalCode", DbType.String, entity.PostalCode );
            database.AddInParameter(commandWrapper, "@Country", DbType.String, entity.Country );
            database.AddInParameter(commandWrapper, "@HomePhone", DbType.String, entity.HomePhone );
            database.AddInParameter(commandWrapper, "@Extension", DbType.String, entity.Extension );
            database.AddInParameter(commandWrapper, "@Photo", DbType.Binary, entity.Photo );
            database.AddInParameter(commandWrapper, "@Notes", DbType.String, entity.Notes );
            database.AddInParameter(commandWrapper, "@ReportsTo", DbType.Int32, (entity.ReportsTo.HasValue ? (object) entity.ReportsTo  : System.DBNull.Value));
            database.AddInParameter(commandWrapper, "@PhotoPath", DbType.String, entity.PhotoPath );

            int results = 0;

            //Provider Data Requesting Command Event
            OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));

            if (transactionManager != null)
            {
                results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
            }
            else
            {
                results = Utility.ExecuteNonQuery(database,commandWrapper);
            }

            object _employeeId = database.GetParameterValue(commandWrapper, "@EmployeeId");
            entity.EmployeeId = (System.Int32)_employeeId;

            entity.AcceptChanges();

            //Provider Data Requested Command Event
            OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

            return Convert.ToBoolean(results);
        }
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.StoreContact object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.StoreContact object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.StoreContact object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.StoreContact entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Sales.usp_adwTiers_StoreContact_Insert", _useStoredProcedure);
			
			database.AddInParameter(commandWrapper, "@CustomerId", DbType.Int32, entity.CustomerId );
			database.AddInParameter(commandWrapper, "@ContactId", DbType.Int32, entity.ContactId );
			database.AddInParameter(commandWrapper, "@ContactTypeId", DbType.Int32, entity.ContactTypeId );
			database.AddOutParameter(commandWrapper, "@Rowguid", DbType.Guid, 16);
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _rowguid = database.GetParameterValue(commandWrapper, "@Rowguid");
			entity.Rowguid = (System.Guid)_rowguid;
			
			entity.OriginalCustomerId = entity.CustomerId;
			entity.OriginalContactId = entity.ContactId;
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
Esempio n. 11
0
        public int InsertContentMaster(string strName, string strContent, Boolean Active)
        {
            int status = 0;
            try
            {
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "InsertContent";
                objDB.AddInParameter(objAdd, "@Title", DbType.String, strName);
                objDB.AddInParameter(objAdd, "@Content", DbType.String, strContent);
                objDB.AddInParameter(objAdd, "@Status", DbType.Boolean, Active);
                objDB.AddOutParameter(objAdd, "@Stat", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Stat"));

                return status;
            }
            catch (Exception ex)
            {
                objErr.GeneralExceptionHandling(ex, "Admin - Add New State", "InsertContentMaster", "GENERAL EXCEPTION");
                return status;
            }
        }
        /// <summary>
        /// 	Inserts a Northwind.Entities.Categories object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Northwind.Entities.Categories object to insert.</param>
        /// <remarks>
        ///		After inserting into the datasource, the Northwind.Entities.Categories object will be updated
        /// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
        /// </remarks>	
        /// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
        public override bool Insert(TransactionManager transactionManager, Northwind.Entities.Categories entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.sp_nt_Categories_Insert", _useStoredProcedure);

            database.AddOutParameter(commandWrapper, "@CategoryId", DbType.Int32, 4);
            database.AddInParameter(commandWrapper, "@CategoryName", DbType.String, entity.CategoryName );
            database.AddInParameter(commandWrapper, "@Description", DbType.String, entity.Description );
            database.AddInParameter(commandWrapper, "@Picture", DbType.Binary, entity.Picture );

            int results = 0;

            //Provider Data Requesting Command Event
            OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));

            if (transactionManager != null)
            {
                results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
            }
            else
            {
                results = Utility.ExecuteNonQuery(database,commandWrapper);
            }

            object _categoryId = database.GetParameterValue(commandWrapper, "@CategoryId");
            entity.CategoryId = (System.Int32)_categoryId;

            entity.AcceptChanges();

            //Provider Data Requested Command Event
            OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

            return Convert.ToBoolean(results);
        }
        /// <summary>
        /// 	Inserts a School.Entities.Students object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">School.Entities.Students object to insert.</param>
        /// <remarks>
        ///		After inserting into the datasource, the School.Entities.Students object will be updated
        /// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
        /// </remarks>	
        /// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
        public override bool Insert(TransactionManager transactionManager, School.Entities.Students entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.Students_Insert", _useStoredProcedure);

            database.AddOutParameter(commandWrapper, "@Id", DbType.Int32, 4);
            database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
            database.AddInParameter(commandWrapper, "@Address", DbType.String, entity.Address );
            database.AddInParameter(commandWrapper, "@ClassId", DbType.Int32, entity.ClassId );
            database.AddInParameter(commandWrapper, "@Birthdate", DbType.Date, entity.Birthdate );
            database.AddInParameter(commandWrapper, "@Gender", DbType.String, entity.Gender );

            int results = 0;

            //Provider Data Requesting Command Event
            OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));

            if (transactionManager != null)
            {
                results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
            }
            else
            {
                results = Utility.ExecuteNonQuery(database,commandWrapper);
            }

            object _id = database.GetParameterValue(commandWrapper, "@Id");
            entity.Id = (System.Int32)_id;

            entity.AcceptChanges();

            //Provider Data Requested Command Event
            OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

            return Convert.ToBoolean(results);
        }
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.SalesPerson object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.SalesPerson object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.SalesPerson object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.SalesPerson entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Sales.usp_adwTiers_SalesPerson_Insert", _useStoredProcedure);
			
			database.AddInParameter(commandWrapper, "@SalesPersonId", DbType.Int32, entity.SalesPersonId );
			database.AddInParameter(commandWrapper, "@TerritoryId", DbType.Int32, (entity.TerritoryId.HasValue ? (object) entity.TerritoryId  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@SalesQuota", DbType.Currency, (entity.SalesQuota.HasValue ? (object) entity.SalesQuota  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@Bonus", DbType.Currency, entity.Bonus );
			database.AddInParameter(commandWrapper, "@CommissionPct", DbType.Currency, entity.CommissionPct );
			database.AddInParameter(commandWrapper, "@SalesYtd", DbType.Currency, entity.SalesYtd );
			database.AddInParameter(commandWrapper, "@SalesLastYear", DbType.Currency, entity.SalesLastYear );
			database.AddOutParameter(commandWrapper, "@Rowguid", DbType.Guid, 16);
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _rowguid = database.GetParameterValue(commandWrapper, "@Rowguid");
			entity.Rowguid = (System.Guid)_rowguid;
			
			entity.OriginalSalesPersonId = entity.SalesPersonId;
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a AppointmentSystem.Entities.GroupRole object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">AppointmentSystem.Entities.GroupRole object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the AppointmentSystem.Entities.GroupRole object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, AppointmentSystem.Entities.GroupRole entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.GroupRole_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@Id", DbType.Int64, 8);
			database.AddInParameter(commandWrapper, "@GroupId", DbType.String, entity.GroupId );
			database.AddInParameter(commandWrapper, "@RoleId", DbType.Int32, (entity.RoleId.HasValue ? (object) entity.RoleId  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@IsDisabled", DbType.Boolean, entity.IsDisabled );
			database.AddInParameter(commandWrapper, "@CreateUser", DbType.String, entity.CreateUser );
			database.AddInParameter(commandWrapper, "@CreateDate", DbType.DateTime, entity.CreateDate );
			database.AddInParameter(commandWrapper, "@UpdateUser", DbType.String, entity.UpdateUser );
			database.AddInParameter(commandWrapper, "@UpdateDate", DbType.DateTime, entity.UpdateDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _id = database.GetParameterValue(commandWrapper, "@Id");
			entity.Id = (System.Int64)_id;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.Customer object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.Customer object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.Customer object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.Customer entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Sales.usp_adwTiers_Customer_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@CustomerId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@TerritoryId", DbType.Int32, (entity.TerritoryId.HasValue ? (object) entity.TerritoryId  : System.DBNull.Value));
			database.AddOutParameter(commandWrapper, "@AccountNumber", DbType.AnsiString, 10);
			database.AddInParameter(commandWrapper, "@CustomerType", DbType.StringFixedLength, entity.CustomerType );
			database.AddOutParameter(commandWrapper, "@Rowguid", DbType.Guid, 16);
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _customerId = database.GetParameterValue(commandWrapper, "@CustomerId");
			entity.CustomerId = (System.Int32)_customerId;
			object _accountNumber = database.GetParameterValue(commandWrapper, "@AccountNumber");
			entity.AccountNumber = (System.String)_accountNumber;
			object _rowguid = database.GetParameterValue(commandWrapper, "@Rowguid");
			entity.Rowguid = (System.Guid)_rowguid;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
        /// <summary>
        /// 	Inserts a Library.BLL.BookImage object into the datasource using a transaction.
        /// </summary>
        /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
        /// <param name="entity">Library.BLL.BookImage object to insert.</param>
        /// <remarks>
        ///		After inserting into the datasource, the Library.BLL.BookImage object will be updated
        /// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
        /// </remarks>	
        /// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
        public override bool Insert(TransactionManager transactionManager, Library.BLL.BookImage entity)
        {
            SqlDatabase database = new SqlDatabase(this._connectionString);
            DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.BookImage_Insert", _useStoredProcedure);

            database.AddOutParameter(commandWrapper, "@ID", DbType.Int32, 4);
            database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
            database.AddInParameter(commandWrapper, "@Format", DbType.String, entity.Format );
            database.AddInParameter(commandWrapper, "@Size", DbType.String, entity.Size );
            database.AddInParameter(commandWrapper, "@Link", DbType.String, entity.Link );
            database.AddInParameter(commandWrapper, "@IsAvailable", DbType.String, entity.IsAvailable );

            int results = 0;

            //Provider Data Requesting Command Event
            OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));

            if (transactionManager != null)
            {
                results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
            }
            else
            {
                results = Utility.ExecuteNonQuery(database,commandWrapper);
            }

            object _iD = database.GetParameterValue(commandWrapper, "@ID");
            entity.ID = (System.Int32)_iD;

            entity.AcceptChanges();

            //Provider Data Requested Command Event
            OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

            return Convert.ToBoolean(results);
        }
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.ProductModel object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.ProductModel object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.ProductModel object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.ProductModel entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Production.usp_adwTiers_ProductModel_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@ProductModelId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
			database.AddInParameter(commandWrapper, "@CatalogDescription", DbType.Xml, entity.CatalogDescription );
			database.AddInParameter(commandWrapper, "@Instructions", DbType.Xml, entity.Instructions );
			database.AddOutParameter(commandWrapper, "@Rowguid", DbType.Guid, 16);
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _productModelId = database.GetParameterValue(commandWrapper, "@ProductModelId");
			entity.ProductModelId = (System.Int32)_productModelId;
			object _rowguid = database.GetParameterValue(commandWrapper, "@Rowguid");
			entity.Rowguid = (System.Guid)_rowguid;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.DatabaseLog object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.DatabaseLog object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.DatabaseLog object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.DatabaseLog entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.usp_adwTiers_DatabaseLog_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@DatabaseLogId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@PostTime", DbType.DateTime, entity.PostTime );
			database.AddInParameter(commandWrapper, "@DatabaseUser", DbType.String, entity.DatabaseUser );
			database.AddInParameter(commandWrapper, "@SafeNameEvent", DbType.String, entity.SafeNameEvent );
			database.AddInParameter(commandWrapper, "@Schema", DbType.String, entity.Schema );
			database.AddInParameter(commandWrapper, "@SafeNameObject", DbType.String, entity.SafeNameObject );
			database.AddInParameter(commandWrapper, "@Tsql", DbType.String, entity.Tsql );
			database.AddInParameter(commandWrapper, "@XmlEvent", DbType.Xml, entity.XmlEvent );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _databaseLogId = database.GetParameterValue(commandWrapper, "@DatabaseLogId");
			entity.DatabaseLogId = (System.Int32)_databaseLogId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
Esempio n. 20
0
        public int UpdateStateMasterbyId(Int32 Id, string strName, Int32 countryId, Boolean Active)
        {
            int status = 0;
            try
            {
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "UpdateStatebyId";
                objDB.AddInParameter(objAdd, "@Id", DbType.Int32, Id);
                objDB.AddInParameter(objAdd, "@Name", DbType.String, strName);
                objDB.AddInParameter(objAdd, "@CountryId", DbType.Int32, countryId);
                objDB.AddInParameter(objAdd, "@Active", DbType.Boolean, Active);
                objDB.AddOutParameter(objAdd, "@Status", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Status"));

                return status;
            }
            catch (Exception ex)
            {
                objErr.GeneralExceptionHandling(ex, "Admin - Update Country Master", "UpdateStateMasterbyId", "GENERAL EXCEPTION");
                return status;
            }
        }
		/// <summary>
		/// 	Inserts a PetShop.Business.Profiles object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">PetShop.Business.Profiles object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the PetShop.Business.Profiles object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, PetShop.Business.Profiles entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.Profiles_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@UniqueId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@Username", DbType.AnsiString, entity.Username );
			database.AddInParameter(commandWrapper, "@ApplicationName", DbType.AnsiString, entity.ApplicationName );
			database.AddInParameter(commandWrapper, "@IsAnonymous", DbType.Boolean, (entity.IsAnonymous.HasValue ? (object) entity.IsAnonymous  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@LastActivityDate", DbType.DateTime, (entity.LastActivityDate.HasValue ? (object) entity.LastActivityDate  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@LastUpdatedDate", DbType.DateTime, (entity.LastUpdatedDate.HasValue ? (object) entity.LastUpdatedDate  : System.DBNull.Value));
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _uniqueId = database.GetParameterValue(commandWrapper, "@UniqueId");
			entity.UniqueId = (System.Int32)_uniqueId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
Esempio n. 22
0
        public int addServicesInquiry(Services objServices)
        {
            int status = 0;
            try
            {
                Database objDB = new SqlDatabase(connectionStr);
                DbCommand objAdd = new SqlCommand();
                objAdd.CommandType = CommandType.StoredProcedure;
                objAdd.CommandText = "InsertServicesInquiry";
                objDB.AddInParameter(objAdd, "@FIRSTNAME", DbType.String, objServices.FirstName);
                objDB.AddInParameter(objAdd, "@LASTNAME", DbType.String, objServices.LastName);
                objDB.AddInParameter(objAdd, "@COMPANYNAME", DbType.String, objServices.CompanyName);
                objDB.AddInParameter(objAdd, "@EMAIL", DbType.String, objServices.Email);
                objDB.AddInParameter(objAdd, "@COUNTRY", DbType.String, objServices.Country);
                objDB.AddInParameter(objAdd, "@CONTACT", DbType.String, objServices.Contact);
                objDB.AddInParameter(objAdd, "@MESSAGE", DbType.String, objServices.Message);
                objDB.AddOutParameter(objAdd, "@Stat", DbType.Int16, 16);
                objDB.ExecuteNonQuery(objAdd);
                status = Convert.ToInt16(objDB.GetParameterValue(objAdd, "@Stat"));

                return status;
            }
            catch (Exception ex)
            {
                objCommom.LogFile("services.aspx", "addServicesInquiry", ex);
                return status;
            }
        }
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.JobCandidate object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.JobCandidate object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.JobCandidate object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.JobCandidate entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "HumanResources.usp_adwTiers_JobCandidate_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@JobCandidateId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@EmployeeId", DbType.Int32, (entity.EmployeeId.HasValue ? (object) entity.EmployeeId  : System.DBNull.Value));
			database.AddInParameter(commandWrapper, "@Resume", DbType.Xml, entity.Resume );
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _jobCandidateId = database.GetParameterValue(commandWrapper, "@JobCandidateId");
			entity.JobCandidateId = (System.Int32)_jobCandidateId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.Vendor object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.Vendor object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.Vendor object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.Vendor entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Purchasing.usp_adwTiers_Vendor_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@VendorId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@AccountNumber", DbType.String, entity.AccountNumber );
			database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
			database.AddInParameter(commandWrapper, "@CreditRating", DbType.Byte, entity.CreditRating );
			database.AddInParameter(commandWrapper, "@PreferredVendorStatus", DbType.Boolean, entity.PreferredVendorStatus );
			database.AddInParameter(commandWrapper, "@ActiveFlag", DbType.Boolean, entity.ActiveFlag );
			database.AddInParameter(commandWrapper, "@PurchasingWebServiceUrl", DbType.String, entity.PurchasingWebServiceUrl );
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _vendorId = database.GetParameterValue(commandWrapper, "@VendorId");
			entity.VendorId = (System.Int32)_vendorId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a PetShop.Business.Orders object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">PetShop.Business.Orders object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the PetShop.Business.Orders object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, PetShop.Business.Orders entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.Orders_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@OrderId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@UserId", DbType.AnsiString, entity.UserId );
			database.AddInParameter(commandWrapper, "@OrderDate", DbType.DateTime, entity.OrderDate );
			database.AddInParameter(commandWrapper, "@ShipAddr1", DbType.AnsiString, entity.ShipAddr1 );
			database.AddInParameter(commandWrapper, "@ShipAddr2", DbType.AnsiString, entity.ShipAddr2 );
			database.AddInParameter(commandWrapper, "@ShipCity", DbType.AnsiString, entity.ShipCity );
			database.AddInParameter(commandWrapper, "@ShipState", DbType.AnsiString, entity.ShipState );
			database.AddInParameter(commandWrapper, "@ShipZip", DbType.AnsiString, entity.ShipZip );
			database.AddInParameter(commandWrapper, "@ShipCountry", DbType.AnsiString, entity.ShipCountry );
			database.AddInParameter(commandWrapper, "@BillAddr1", DbType.AnsiString, entity.BillAddr1 );
			database.AddInParameter(commandWrapper, "@BillAddr2", DbType.AnsiString, entity.BillAddr2 );
			database.AddInParameter(commandWrapper, "@BillCity", DbType.AnsiString, entity.BillCity );
			database.AddInParameter(commandWrapper, "@BillState", DbType.AnsiString, entity.BillState );
			database.AddInParameter(commandWrapper, "@BillZip", DbType.AnsiString, entity.BillZip );
			database.AddInParameter(commandWrapper, "@BillCountry", DbType.AnsiString, entity.BillCountry );
			database.AddInParameter(commandWrapper, "@Courier", DbType.AnsiString, entity.Courier );
			database.AddInParameter(commandWrapper, "@TotalPrice", DbType.Decimal, entity.TotalPrice );
			database.AddInParameter(commandWrapper, "@BillToFirstName", DbType.AnsiString, entity.BillToFirstName );
			database.AddInParameter(commandWrapper, "@BillToLastName", DbType.AnsiString, entity.BillToLastName );
			database.AddInParameter(commandWrapper, "@ShipToFirstName", DbType.AnsiString, entity.ShipToFirstName );
			database.AddInParameter(commandWrapper, "@ShipToLastName", DbType.AnsiString, entity.ShipToLastName );
			database.AddInParameter(commandWrapper, "@AuthorizationNumber", DbType.Int32, entity.AuthorizationNumber );
			database.AddInParameter(commandWrapper, "@Locale", DbType.AnsiString, entity.Locale );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _orderId = database.GetParameterValue(commandWrapper, "@OrderId");
			entity.OrderId = (int)_orderId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.StateProvince object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.StateProvince object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.StateProvince object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.StateProvince entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Person.usp_adwTiers_StateProvince_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@StateProvinceId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@StateProvinceCode", DbType.StringFixedLength, entity.StateProvinceCode );
			database.AddInParameter(commandWrapper, "@CountryRegionCode", DbType.String, entity.CountryRegionCode );
			database.AddInParameter(commandWrapper, "@IsOnlyStateProvinceFlag", DbType.Boolean, entity.IsOnlyStateProvinceFlag );
			database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
			database.AddInParameter(commandWrapper, "@TerritoryId", DbType.Int32, entity.TerritoryId );
			database.AddOutParameter(commandWrapper, "@Rowguid", DbType.Guid, 16);
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _stateProvinceId = database.GetParameterValue(commandWrapper, "@StateProvinceId");
			entity.StateProvinceId = (System.Int32)_stateProvinceId;
			object _rowguid = database.GetParameterValue(commandWrapper, "@Rowguid");
			entity.Rowguid = (System.Guid)_rowguid;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a ClinicDoctor.Entities.RosterType object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">ClinicDoctor.Entities.RosterType object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the ClinicDoctor.Entities.RosterType object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, ClinicDoctor.Entities.RosterType entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.RosterType_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@Id", DbType.Int64, 8);
			database.AddInParameter(commandWrapper, "@Title", DbType.String, entity.Title );
			database.AddInParameter(commandWrapper, "@IsBooked", DbType.Boolean, entity.IsBooked );
			database.AddInParameter(commandWrapper, "@ColorCode", DbType.String, entity.ColorCode );
			database.AddInParameter(commandWrapper, "@Note", DbType.String, entity.Note );
			database.AddInParameter(commandWrapper, "@IsDisabled", DbType.Boolean, entity.IsDisabled );
			database.AddInParameter(commandWrapper, "@CreateUser", DbType.String, entity.CreateUser );
			database.AddInParameter(commandWrapper, "@CreateDate", DbType.DateTime, entity.CreateDate );
			database.AddInParameter(commandWrapper, "@UpdateUser", DbType.String, entity.UpdateUser );
			database.AddInParameter(commandWrapper, "@UpdateDate", DbType.DateTime, entity.UpdateDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _id = database.GetParameterValue(commandWrapper, "@Id");
			entity.Id = (System.Int64)_id;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.Department object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.Department object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.Department object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.Department entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "HumanResources.usp_adwTiers_Department_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@DepartmentId", DbType.Int16, 2);
			database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
			database.AddInParameter(commandWrapper, "@GroupName", DbType.String, entity.GroupName );
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _departmentId = database.GetParameterValue(commandWrapper, "@DepartmentId");
			entity.DepartmentId = (System.Int16)_departmentId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a Nettiers.AdventureWorks.Entities.TransactionHistory object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">Nettiers.AdventureWorks.Entities.TransactionHistory object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.TransactionHistory object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.TransactionHistory entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Production.usp_adwTiers_TransactionHistory_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@TransactionId", DbType.Int32, 4);
			database.AddInParameter(commandWrapper, "@ProductId", DbType.Int32, entity.ProductId );
			database.AddInParameter(commandWrapper, "@ReferenceOrderId", DbType.Int32, entity.ReferenceOrderId );
			database.AddInParameter(commandWrapper, "@ReferenceOrderLineId", DbType.Int32, entity.ReferenceOrderLineId );
			database.AddInParameter(commandWrapper, "@TransactionDate", DbType.DateTime, entity.TransactionDate );
			database.AddInParameter(commandWrapper, "@TransactionType", DbType.StringFixedLength, entity.TransactionType );
			database.AddInParameter(commandWrapper, "@Quantity", DbType.Int32, entity.Quantity );
			database.AddInParameter(commandWrapper, "@ActualCost", DbType.Currency, entity.ActualCost );
			database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _transactionId = database.GetParameterValue(commandWrapper, "@TransactionId");
			entity.TransactionId = (System.Int32)_transactionId;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}	
		/// <summary>
		/// 	Inserts a AppointmentSystem.Entities.SmsReceiver object into the datasource using a transaction.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">AppointmentSystem.Entities.SmsReceiver object to insert.</param>
		/// <remarks>
		///		After inserting into the datasource, the AppointmentSystem.Entities.SmsReceiver object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		/// <returns>Returns true if operation is successful.</returns>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override bool Insert(TransactionManager transactionManager, AppointmentSystem.Entities.SmsReceiver entity)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "dbo.SmsReceiver_Insert", _useStoredProcedure);
			
			database.AddOutParameter(commandWrapper, "@Id", DbType.Int64, 8);
			database.AddInParameter(commandWrapper, "@Mobile", DbType.AnsiString, entity.Mobile );
			database.AddInParameter(commandWrapper, "@FirstName", DbType.String, entity.FirstName );
			database.AddInParameter(commandWrapper, "@LastName", DbType.String, entity.LastName );
			database.AddInParameter(commandWrapper, "@UserType", DbType.Byte, entity.UserType );
			database.AddInParameter(commandWrapper, "@SmsId", DbType.Int64, entity.SmsId );
			database.AddInParameter(commandWrapper, "@IsSent", DbType.Boolean, entity.IsSent );
			database.AddInParameter(commandWrapper, "@SendingTimes", DbType.Int32, entity.SendingTimes );
			database.AddInParameter(commandWrapper, "@Note", DbType.String, entity.Note );
			database.AddInParameter(commandWrapper, "@IsDisabled", DbType.Boolean, entity.IsDisabled );
			database.AddInParameter(commandWrapper, "@CreateUser", DbType.String, entity.CreateUser );
			database.AddInParameter(commandWrapper, "@CreateDate", DbType.DateTime, entity.CreateDate );
			database.AddInParameter(commandWrapper, "@UpdateUser", DbType.String, entity.UpdateUser );
			database.AddInParameter(commandWrapper, "@UpdateDate", DbType.DateTime, entity.UpdateDate );
			
			int results = 0;
			
			//Provider Data Requesting Command Event
			OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
				
			if (transactionManager != null)
			{
				results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
			}
			else
			{
				results = Utility.ExecuteNonQuery(database,commandWrapper);
			}
					
			object _id = database.GetParameterValue(commandWrapper, "@Id");
			entity.Id = (System.Int64)_id;
			
			
			entity.AcceptChanges();
	
			//Provider Data Requested Command Event
			OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));

			return Convert.ToBoolean(results);
		}