public void ReportByQuantity(int Quantity) { //filters the records based on a full or partial location //connect to the database clsDataConnection DB = new clsDataConnection(); //send the quantity parameter to the database DB.AddParameter("@Quantity", Quantity); //execute the stored procedure DB.Execute("sproc_tblStock_FilterByQuantity"); //populate the array list with the data table PopulateArray(DB); }
public int Add() { //adds a new record to the database based on the values of ThisStock //connect to the database clsDataConnection DB = new clsDataConnection(); //set parameters for the stored procedure DB.AddParameter("@Name", mThisCustomer.Name); DB.AddParameter("@Email", mThisCustomer.Email); DB.AddParameter("@DOB", mThisCustomer.DOB); DB.AddParameter("@Address", mThisCustomer.Address); DB.AddParameter("@Registered", mThisCustomer.Registered); //execute the querry returnining the primary key value return(DB.Execute("sproc_tblCustomer_Insert")); }
public int Add() { //adds a new record to the data base based on the values of mThisRoomtype //set the primary key value of the new record clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@RoomFloorNo", mThisRoomtype.RoomFloorNo); DB.AddParameter("@RoomtypeSize", mThisRoomtype.RoomtypeSize); DB.AddParameter("@Roomtype", mThisRoomtype.Roomtype); DB.AddParameter("@DateTime", mThisRoomtype.DateTime); DB.AddParameter("@Active", mThisRoomtype.Active); //execute the query returning the primary key value return(DB.Execute("sproc_tblRoomtype_Insert")); }
public void Update() { //update an existing record based on the values of thisBooking //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("BookingID", mThisBooking.BookingID); DB.AddParameter("Station_Origin", mThisBooking.Station_Origin); DB.AddParameter("Station_Destination", mThisBooking.Station_Destination); DB.AddParameter("Type", mThisBooking.Type); DB.AddParameter("Date", mThisBooking.Date); //execute the stored procedure DB.Execute("sproc_tblBooking_Update"); }
public int Add() { //connect to the database dBConnection = new clsDataConnection(); //add a new record to the database based on the values of ThisSupport //set the parameters for the stored procedure dBConnection.AddParameter("@Email", mThisSupport.Email); dBConnection.AddParameter("@Name", mThisSupport.Name); dBConnection.AddParameter("@Phonenum", mThisSupport.Phonenum); dBConnection.AddParameter("@Description", mThisSupport.Description); dBConnection.AddParameter("@DateSubmitted", mThisSupport.DateSubmitted); //execute the query returning the primary key value return(dBConnection.Execute("sproc_tblSupport_Insert")); }
// public clsCustomer mThisCustomer { get; private set; } public int Add() { //adds a new record to the database based on the values of mThisCustomer //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@Username", mThisCustomer.Username); DB.AddParameter("@Password", mThisCustomer.Password); DB.AddParameter("@DateAdded", mThisCustomer.DateAdded); DB.AddParameter("@Address", mThisCustomer.Address); DB.AddParameter("@Active", mThisCustomer.Active); //execute the query returning the primary key value return(DB.Execute("sproc_tblCustomer_Insert")); }
public int Add() { //adds the new record to the database based on the values for mThisOrder //connects to the database clsDataConnection DB = new clsDataConnection(); //sets the prarameters for stored procedures DB.AddParameter("@orderStatus", mthisOrder.OrderStatus); DB.AddParameter("@ShippingAddress", mthisOrder.ShippingAddress); DB.AddParameter("@orderDate", mthisOrder.OrderDate); DB.AddParameter("@OrderShipped", mthisOrder.OrderShipped); DB.AddParameter("@customerID", mthisOrder.CustomerID); //executes query returning of the primary key value return(DB.Execute("sproc_tblOrder_Insert")); }
public void Update() { //update an existing record based on the values of thisStaffMember clsDataConnection DB = new clsDataConnection(); DB.AddParameter("@StaffId", mThisStaffMember.StaffId); DB.AddParameter("@FirstName", mThisStaffMember.FirstName); DB.AddParameter("@LastName", mThisStaffMember.LastName); DB.AddParameter("@EmailAddress", mThisStaffMember.EmailAddress); DB.AddParameter("@HomeAddress", mThisStaffMember.HomeAddress); DB.AddParameter("@StartDate", mThisStaffMember.StartDate); DB.AddParameter("@IsWorking", mThisStaffMember.IsWorking); //executing the stored procedure DB.Execute("sproc_tblStaff_Update"); }
public void Update() { { //update an existing record based on the values of thisaddress //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@FoodID", thisFood.FoodID); DB.AddParameter("@FoodName", thisFood.FoodName); DB.AddParameter("@FoodPrice", thisFood.FoodPrice); DB.AddParameter("@Quantity", thisFood.Quantity); //execute the query returning the primary key value DB.Execute("sproc_tblFood_InsertFood"); } }
public int Add() { dBConnection = new clsDataConnection(); //add a new record to the database based on the values of ThisOrder //connect to the database //clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure dBConnection.AddParameter("@ShippingAddress", mThisOrder.ShippingAddress); dBConnection.AddParameter("@Phonenum", mThisOrder.Phonenum); dBConnection.AddParameter("@Email", mThisOrder.Email); dBConnection.AddParameter("@TotalPrice", mThisOrder.TotalPrice); dBConnection.AddParameter("@DateOrdered", mThisOrder.DateOrdered); //execute the query returning the primary key value return(dBConnection.Execute("sproc_tblOrder_Insert")); }
public int Add() { //adds a new record to the datatbase base don the values of mThisCustomer //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@CustomerName", mThisCustomer.CustomerName); DB.AddParameter("@CustomerDOB", mThisCustomer.CustomerDOB); DB.AddParameter("@CustomerEmailAddress", mThisCustomer.CustomerEmailAddress); DB.AddParameter("@CustomerAddress", mThisCustomer.CustomerAddress); DB.AddParameter("@Member", mThisCustomer.Member); //execute the query returning the primary key value return(DB.Execute("sproc_tblCustomer_Insert")); }
public void Update() { //create new instance of data connection class clsDataConnection DB = new clsDataConnection(); //implements paramaters to the correct fields to create new stock DB.AddParameter("@gameID", mThisStock.gameID); DB.AddParameter("@gameName", mThisStock.gameName); DB.AddParameter("@Availability", mThisStock.Availability); DB.AddParameter("@ageRating", mThisStock.AgeRating); DB.AddParameter("@Price", mThisStock.Price); DB.AddParameter("@releaseDate", mThisStock.ReleaseDate); //execute correct stored procedures which allow for data to be updated DB.Execute("sproc_tblStock_Update"); }
public void Update() { // update an existing record based on the value of ThisDestination // connect to the data connection class clsDataConnection DB = new clsDataConnection(); // set the parameters DB.AddParameter("@DestinationID", mThisDestination.DestinationID); DB.AddParameter("@DestinationName", mThisDestination.Destination); DB.AddParameter("@PricePerPerson", mThisDestination.PricePerPerson); DB.AddParameter("@DayOfFlight", mThisDestination.DayOfFlight); DB.AddParameter("@ReturnDate", mThisDestination.ReturnDate); // execute the stored procedure DB.Execute("sproc_tblDestination_Update"); }
public int Update() { clsDataConnection DB = new clsDataConnection(); DB.AddParameter("@ProductNo", mThisCustomer.ProductNo); DB.AddParameter("@FullName", mThisCustomer.FullName); DB.AddParameter("@Address", mThisCustomer.Address); DB.AddParameter("@Email", mThisCustomer.Email); DB.AddParameter("@OrderNo", mThisCustomer.OrderNo); DB.AddParameter("@CustomerID", mThisCustomer.CustomerID); DB.AddParameter("@Date", mThisCustomer.Date); DB.AddParameter("@PhoneNumber", mThisCustomer.PhoneNumber); //DB.AddParameter("@Active", mThisCustomer.Active); return(DB.Execute("sproc_tblCustomer_FJ_Update")); }
public int Add() { //adds a new record to the database based on the values of mThisOrder //set the primary key value of the new record clsDataConnection DB = new clsDataConnection(); //return primary key of the new record DB.AddParameter("@ItemName", mThisOrder.ItemName); DB.AddParameter("@Price", mThisOrder.Price); DB.AddParameter("@DateOrderMade", mThisOrder.DateOrderMade); DB.AddParameter("@ItemShipped", mThisOrder.ItemShipped); //execute the query returning the primary key value return(DB.Execute("sproc_tblOrder_Insert")); }
public void Update() { //adds a new record to the database based on the values of mThisOrder //set the primary key value of the new record clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@OrderId", mThisOrder.OrderId); DB.AddParameter("@ItemName", mThisOrder.ItemName); DB.AddParameter("@Price", mThisOrder.Price); DB.AddParameter("@DateOrderMade", mThisOrder.DateOrderMade); DB.AddParameter("@ItemShipped", mThisOrder.ItemShipped); //execute the stored procedure DB.Execute("sproc_tblOrder_Update"); }
public int Add() { //adds a new record to the database based on the values of ThisStock //connect to the database clsDataConnection DB = new clsDataConnection(); //set parameters for the stored procedure DB.AddParameter("@Available", mThisStock.Available); DB.AddParameter("@BookName", mThisStock.BookName); DB.AddParameter("@AuthorName", mThisStock.AuthorName); DB.AddParameter("@Price", mThisStock.Price); DB.AddParameter("@PublishDate", mThisStock.PublishDate); //execute the querry returnining the primary key value return(DB.Execute("sproc_tblStockManagement_Insert")); }
public int Add() { //connect to the database dBConnection = new clsDataConnection(); //add a new record to the database based on the values of ThisInventory //set the parameters for the stored procedure dBConnection.AddParameter("@Email", mThisSellerShopLine.Email); dBConnection.AddParameter("@Price", mThisSellerShopLine.Price); dBConnection.AddParameter("@Quantity", mThisSellerShopLine.Quantity); dBConnection.AddParameter("@ProductName", mThisSellerShopLine.ProductName); dBConnection.AddParameter("@Description", mThisSellerShopLine.Description); dBConnection.AddParameter("@Active", mThisSellerShopLine.Active); //execute the query returning the primary key value return(dBConnection.Execute("sproc_tblSellerShopLine_Insert")); }
public int Add() { //adds a new record to the database based on the values of mThisStock //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@Description", mThisStock.Description); DB.AddParameter("@LastEdited", mThisStock.LastEdited); DB.AddParameter("@Price", mThisStock.Price); DB.AddParameter("@Quantity", mThisStock.Quantity); DB.AddParameter("@InStock", mThisStock.InStock); //execute the query returning the primary key value return(DB.Execute("sproc_tblStock_Insert")); }
public int Add() { // Adds a new record to the database based on the values of mStaff. // Conect to the database. clsDataConnection DB = new clsDataConnection(); // Set the parameters for the stored procedure. DB.AddParameter("@StaffName", mStaff.StaffName); DB.AddParameter("@DOB", mStaff.DateOfBirth); DB.AddParameter("@Wage", mStaff.Wage); DB.AddParameter("@Email", mStaff.Email); DB.AddParameter("@GrantAccess", mStaff.GrantAccess); // Execute the query return the primary key value. return(DB.Execute("sproc_tblStaff_Insert")); }
public int Add() { // connect to the database clsDataConnection DB = new clsDataConnection(); // set the parameters for the stored procedure DB.AddParameter("@TotalPrice", mThisBooking.TotalPrice); DB.AddParameter("@BookingApproved", mThisBooking.BookingApproved); DB.AddParameter("@DestinationID", mThisBooking.DestinationID); DB.AddParameter("@BookingDate", mThisBooking.BookingDate); DB.AddParameter("@CarParkID", mThisBooking.CarParkID); DB.AddParameter("@CustomerNo", mThisBooking.CustomerNo); // execute the query returning the primary key return(DB.Execute("sproc_tblBooking_InsertBooking")); }
public int Add() { //Adds a new record to the database based on the values of mThisOrder //Connect to the database clsDataConnection DB = new clsDataConnection(); //Set the parameters for the stored procedure DB.AddParameter("@OrderDate", mThisOrder.DateAdded); DB.AddParameter("@ShippingAddress", mThisOrder.ShippingAddress); DB.AddParameter("@OrderDelivery", mThisOrder.Delivery); DB.AddParameter("@OrderDesc", mThisOrder.Description); DB.AddParameter("@OrderQuantity", mThisOrder.OrderQuantity); //Execute the query returning the primary key value return(DB.Execute("sproc_tblOrder_Insert")); }
public void ReportByEmployeeName(string EmployeeName) { //filters the records based on full or partial employee name //connect to the database clsDataConnection DB = new clsDataConnection(); //send the EmployeeName parameter to the database DB.AddParameter("@EmployeeName", EmployeeName); //execute the stored procedure DB.Execute("sproc_tblManagmentTable_FilterByEmployeeName"); //populate array list with the data table PopulateArray(DB); }
// constructor for the class public clsCardDetailsCollection() { // var to store the index Int32 Index = 0; // var to store the record count Int32 RecordCount = 0; // object for the data connection clsDataConnection DB = new clsDataConnection(); // execute the stored procedure DB.Execute("sproc_tblCardDetails_SelectAll"); // get the count of records while (Index < RecordCount) { clsCardDetails ACardDetails = new clsCardDetails(); // read in the fields from the current record ACardDetails.CardNo = Convert.ToInt32(DB.DataTable.Rows[Index]["CardNo"]); ACardDetails.CardNo1 = Convert.ToString(DB.DataTable.Rows[Index]["Card1No"]); // add the record to the private data member mCardDetailsList.Add(ACardDetails); // point at the next record Index++; } //clsCardDetails TestItem = new clsCardDetails(); //// set its properties //TestItem.CardNo = 1; //TestItem.CardNo1 = "123456"; //TestItem.OrderNo = 1; //// add the item to the list //mCardDetailsList.Add(TestItem); //// re initialise the object for some new data //TestItem = new clsCardDetails(); //// set its properties //TestItem.CardNo = 2; //TestItem.CardNo1 = "654321"; //TestItem.OrderNo = 2; //// add the item to the list //mCardDetailsList.Add(TestItem); //clsDataConnection DB = new clsDataConnection(); //// execute the stored procedure //DB.Execute("sproc_tblCardDetails_SelectAll"); //// poplate the array list with the data //PopulateArray(DB); }
public int Add() { //adds a new record to the database based on the values of thisStaff //connect to the database clsDataConnection DB = new clsDataConnection(); //set the params for the stored proc //DB.AddParameter("@StaffNo", mThisStaff.StaffNo); DB.AddParameter("@Firstname", mThisStaff.FirstName); DB.AddParameter("@LastName", mThisStaff.LastName); DB.AddParameter("@Email", mThisStaff.Email); DB.AddParameter("@Position", mThisStaff.Position); DB.AddParameter("@TeleNo", mThisStaff.TeleNo); //execute the query returning the PK balue return(DB.Execute("sproc_tblStaff_Insert")); }
public void Update() { dBConnection = new clsDataConnection(); //update an existing record based on the values of thisStaff //connect to the database //clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure dBConnection.AddParameter("@StaffId", mThisStaff.StaffId); dBConnection.AddParameter("@Name", mThisStaff.Name); dBConnection.AddParameter("@Phonenum", mThisStaff.Phonenum); dBConnection.AddParameter("@Salary", mThisStaff.Salary); dBConnection.AddParameter("@DateJoined", mThisStaff.DateJoined); dBConnection.AddParameter("@Active", mThisStaff.Active); //execute the stored procedure dBConnection.Execute("sproc_tblStaff_Update"); }
public void Update() { //update an existing record based on the values of thisAddress //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@StaffID", mThisStaff.StaffID); DB.AddParameter("@StaffName", mThisStaff.StaffName); DB.AddParameter("@StaffSalary", mThisStaff.StaffSalary); DB.AddParameter("@StaffEmail", mThisStaff.StaffEmailAddress); DB.AddParameter("@StaffDOB", mThisStaff.StaffDOB); DB.AddParameter("@EmployerEmployee", mThisStaff.Employer); //execture the stored procedure DB.Execute("sproc_tblStaff_Update"); }
public void Update() { //update an existing record based on the values of thisCustomer //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@CustomerId", mThisCustomer.CustomerId); DB.AddParameter("@Username", mThisCustomer.Username); DB.AddParameter("@Password", mThisCustomer.Password); DB.AddParameter("@Address", mThisCustomer.Address); DB.AddParameter("@DateOfBirth", mThisCustomer.DateOfBirth); DB.AddParameter("@ReceiveMail", mThisCustomer.ReceiveMail); //execture the stored procedure DB.Execute("sproc_tblCustomerDetails_Update"); }
public void Update() { //update an existing record based on the values of thisStaff //connect to the database clsDataConnection DB = new clsDataConnection(); //set the parameters for the stored procedure DB.AddParameter("@StaffId", mthisStaff.StaffId); DB.AddParameter("@Name", mthisStaff.Name); DB.AddParameter("@DateStarted", mthisStaff.DateStarted); DB.AddParameter("@JobRole", mthisStaff.JobRole); DB.AddParameter("@Email", mthisStaff.Email); DB.AddParameter("@StaffExists", mthisStaff.StaffExists); //execute the stored procedure DB.Execute("sproc_tblStaff_Update"); }
public void Update() { //adds a new record to the database based on the values of mthisstaff // connect to database clsDataConnection DB = new clsDataConnection(); // Set the parameters for the stored procedure DB.AddParameter("@StaffId", mThisStaff.StaffId); DB.AddParameter("@FullName", mThisStaff.FullName); DB.AddParameter("@PhoneNumber", mThisStaff.PhoneNumber); DB.AddParameter("@HourlyWage", mThisStaff.HourlyWage); DB.AddParameter("@DateOfBirth", mThisStaff.DateOfBirth); DB.AddParameter("@IsWorking", mThisStaff.IsWorking); // Execute the stored procedure DB.Execute("sproc_tblStaff_Update"); }