void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount; RecordCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < RecordCount) { clsCustomer ACustomer = new clsCustomer(); ACustomer.CustomerSubscribe = Convert.ToBoolean(DB.DataTable.Rows[Index]["customerSubscribe"]); ACustomer.CustomerName = Convert.ToString(DB.DataTable.Rows[Index]["customerName"]); ACustomer.CustomerId = Convert.ToInt32(DB.DataTable.Rows[Index]["customerId"]); ACustomer.CustomerEmail = Convert.ToString(DB.DataTable.Rows[Index]["customerEmail"]); ACustomer.CustomerDOB = Convert.ToDateTime(DB.DataTable.Rows[Index]["customerDOB"]); mCustomerList.Add(ACustomer); Index++; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 NameCount; NameCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < NameCount) { clsCustomer ACustomer = new clsCustomer(); ACustomer.CustomerId = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerId"]); ACustomer.Name = Convert.ToString(DB.DataTable.Rows[Index]["CustomerName"]); ACustomer.Address = Convert.ToString(DB.DataTable.Rows[Index]["Address"]); ACustomer.Postcode = Convert.ToString(DB.DataTable.Rows[Index]["Postcode"]); ACustomer.DoB = Convert.ToDateTime(DB.DataTable.Rows[Index]["DoB"]); ACustomer.GdprRequest = Convert.ToBoolean(DB.DataTable.Rows[Index]["GdprRequest"]); mCustomerList.Add(ACustomer); Index++; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount = 0; RecordCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < RecordCount) { clsCustomer ACustomer = new clsCustomer(); ACustomer.ActiveAcc = Convert.ToBoolean(DB.DataTable.Rows[Index]["ActiveAcc"]); ACustomer.CustomerID = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerID"]); ACustomer.CustomerPwd = Convert.ToString(DB.DataTable.Rows[Index]["CustomerPwd"]); ACustomer.FirstName = Convert.ToString(DB.DataTable.Rows[Index]["FirstName"]); ACustomer.LastName = Convert.ToString(DB.DataTable.Rows[Index]["LastName"]); ACustomer.DateOfBirth = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateOfBirth"]); mCustomerList.Add(ACustomer); Index++; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount; RecordCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < RecordCount) { clsCustomer ACustomer = new clsCustomer(); ACustomer.CustomerId = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerId"]); ACustomer.Username = Convert.ToString(DB.DataTable.Rows[Index]["Username"]); ACustomer.Password = Convert.ToString(DB.DataTable.Rows[Index]["Password"]); ACustomer.Email = Convert.ToString(DB.DataTable.Rows[Index]["Email"]); ACustomer.DateCreated = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateCreated"]); ACustomer.Active = Convert.ToBoolean(DB.DataTable.Rows[Index]["ActiveAccount"]); mCustomerList.Add(ACustomer); Index++; } }
public clsCustomerCollection() { Int32 Index = 0; Int32 RecordCount = 0; clsDataConnection DB = new clsDataConnection(); DB.Execute("sproc_tblCustomer_SelectAll"); RecordCount = DB.Count; while (Index < RecordCount) { clsCustomer AnCustomer = new clsCustomer(); AnCustomer.CurrentOrder = Convert.ToBoolean(DB.DataTable.Rows[Index]["CurrentOrder"]); AnCustomer.CustomerNo = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerNo"]); AnCustomer.CustomerName = Convert.ToString(DB.DataTable.Rows[Index]["CustomerName"]); AnCustomer.CustomerEmail = Convert.ToString(DB.DataTable.Rows[Index]["CustomerEmail"]); AnCustomer.CustomerBillingAddress = Convert.ToString(DB.DataTable.Rows[Index]["CustomerBillingAddress"]); AnCustomer.CustomerShippingAddress = Convert.ToString(DB.DataTable.Rows[Index]["CustomerShippingAddress"]); mCustomerList.Add(AnCustomer); Index++; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount; RecordCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < RecordCount) { clsCustomer TestItem = new clsCustomer(); TestItem.AccountVerified = Convert.ToBoolean(DB.DataTable.Rows[Index]["AccountVerified"]); TestItem.AccountNo = Convert.ToInt32(DB.DataTable.Rows[Index]["AccountNo"]); TestItem.Ballance = Convert.ToInt32(DB.DataTable.Rows[Index]["Ballance"]); TestItem.CustomerName = Convert.ToString(DB.DataTable.Rows[Index]["CustomerName"]); TestItem.CustomerEmail = Convert.ToString(DB.DataTable.Rows[Index]["CustomerEmail"]); TestItem.DateAdded = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateAdded"]); TestItem.DateOfBirth = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateOfBirth"]); mCustomerList.Add(TestItem); Index++; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount; RecordCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < RecordCount) { clsCustomer AnCustomer = new clsCustomer(); AnCustomer.CustomerNumber = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerNumber"]); AnCustomer.CustomerName = Convert.ToString(DB.DataTable.Rows[Index]["CustomerName"]); AnCustomer.CustomerEmail = Convert.ToString(DB.DataTable.Rows[Index]["email"]); AnCustomer.CustomerDOB = Convert.ToDateTime(DB.DataTable.Rows[Index]["DOB"]); AnCustomer.CustomerGender = Convert.ToString(DB.DataTable.Rows[Index]["Gender"]); AnCustomer.CustomerPostcode = Convert.ToString(DB.DataTable.Rows[Index]["Postcode"]); mCustomerList.Add(AnCustomer); Index++; } }
void PopulateArray(clsDataConnection DB) { Int32 Index = 0; Int32 RecordCount; RecordCount = DB.Count; mCustomerList = new List <clsCustomer>(); while (Index < RecordCount) { clsCustomer ACustomer = new clsCustomer(); ACustomer.CustomerId = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerId"]); ACustomer.Name = Convert.ToString(DB.DataTable.Rows[Index]["Name"]); ACustomer.DateOfBirth = Convert.ToDateTime(DB.DataTable.Rows[Index]["DateOfBirth"]); ACustomer.Address = Convert.ToString(DB.DataTable.Rows[Index]["Address"]); ACustomer.Email = Convert.ToString(DB.DataTable.Rows[Index]["Email"]); ACustomer.IsMember = Convert.ToBoolean(DB.DataTable.Rows[Index]["IsMember"]); mCustomerList.Add(ACustomer); Index++; } }
void PopulateArray(clsDataConnection DB) { //poulates the array list based on the data table in the parameter DB //var for the index Int32 Index = 0; //var to store the record count Int32 RecordCount; //get the count of the records RecordCount = DB.Count; //clear the private array list mCustomerList = new List <clsCustomer>(); //while there are no records to process while (Index < RecordCount) { //create a blank address clsCustomer ACustomer = new clsCustomer(); //read in the fields from the current record ACustomer.CustomerId = Convert.ToInt32(DB.DataTable.Rows[Index]["CustomerId"]); ACustomer.CustomerName = Convert.ToString(DB.DataTable.Rows[Index]["CustomerName"]); ACustomer.CustomerEmail = Convert.ToString(DB.DataTable.Rows[Index]["CustomerEmail"]); ACustomer.CustomerPassword = Convert.ToString(DB.DataTable.Rows[Index]["CustomerPassword"]); ACustomer.CustomerCardNumber = Convert.ToString(DB.DataTable.Rows[Index]["CustomerCardNumber"]); ACustomer.CustomerCreationDate = Convert.ToDateTime(DB.DataTable.Rows[Index]["CustomerCreationDate"]); ACustomer.CustomerAccountStatus = Convert.ToBoolean(DB.DataTable.Rows[Index]["CustomerAccountStatus"]); //add the record to the private member mCustomerList.Add(ACustomer); //point at the next record Index++; } }
protected void btnSubmit_Click(object sender, EventArgs e) { //create an instance of the code ClassLibrary.clsCustomer ACustomer = new ClassLibrary.clsCustomer(); //var for errors string Error; //declare vars string CustomerFirstName; string CustomerLastName; string CustomerEmail; string CustomerPostcode; string CustomerTelNo; //read inputs CustomerFirstName = txtCustomerFirstName.Text; CustomerLastName = txtCustomerLastName.Text; CustomerEmail = txtCustomerEmail.Text; CustomerPostcode = txtCustomerPostcode.Text; CustomerTelNo = txtCustomerTelNo.Text; //validate data Error = ACustomer.CustomerValidated(CustomerFirstName, CustomerLastName, CustomerEmail, CustomerPostcode, CustomerTelNo); //display error lblError.Text = Error; }