protected void btnFind_Click(object sender, EventArgs e)
    {
        //create the instance of the customer class
        clsCustomer ACustomer = new clsCustomer();
        //variable to store the primary key
        Int32 CustomerNo;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        CustomerNo = Convert.ToInt32(txtCustomerNo.Text);
        // Find the record
        Found = ACustomer.Find(CustomerNo);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtTitle.Text         = ACustomer.Title;
            txtForeName.Text      = ACustomer.ForeName;
            txtLastName.Text      = ACustomer.LastName;
            txtCustomerEmail.Text = ACustomer.Email;
            txtDateAdded.Text     = ACustomer.DateAdded.ToString();
            txtPhoneNo.Text       = ACustomer.PhoneNo.ToString();
        }
    }
    protected void BtnFind_Click(object sender, EventArgs e)
    {
        clsCustomer ACustomer = new clsCustomer();
        // variable to store the primary key
        Int32 CustomerID;
        // Variable to store result of the find operation.
        Boolean Found = false;

        // Get the primary key (CustomerID) entered by the user
        CustomerID = Convert.ToInt32(txtCustomerID.Text);
        // Find the record
        Found = ACustomer.Find(CustomerID);
        // If found
        if (Found == true)
        {
            txtFirstName.Text               = ACustomer.CustomerFirstName;
            txtLastName.Text                = ACustomer.CustomerLastName;
            txtPhoneNumber.Text             = ACustomer.CustomerPhoneNumber;
            txtAddress.Text                 = ACustomer.Address;
            txtEmailAddress.Text            = ACustomer.CustomerEmail;
            txtDateOfBirth.Text             = ACustomer.CustomerDOB.ToString();
            txtPassword.Text                = ACustomer.CustomerPassword;
            txtPostcode.Text                = ACustomer.PostCode;
            OptInMarketingCompleted.Checked = ACustomer.Marketing;
            ActiveCompleted.Checked         = ACustomer.Active;
        }
        else
        {
            Response.Redirect("CustomerError.aspx");
        }
    }
Esempio n. 3
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsCustomer ACustomer  = new clsCustomer();
        int         CustomerId = Convert.ToInt32(txtCustomerId.Text);
        bool        Found      = false;

        Found = ACustomer.Find(CustomerId);

        if (Found)
        {
            txtName.Text        = ACustomer.Name;
            txtDateOfBirth.Text = Convert.ToString(ACustomer.DateOfBirth);
            txtAddress.Text     = ACustomer.Address;
            txtEmail.Text       = ACustomer.Email;

            if (ACustomer.IsMember)
            {
                chkIsMember.Checked = true;
            }
            else
            {
                chkIsMember.Checked = false;
            }
        }
    }
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create an instance of clsCustomer
        clsCustomer ACustomer = new clsCustomer();
        //variable to store the primary key
        Int32 CustomerId;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        CustomerId = Convert.ToInt32(txtCustomerId.Text);
        //find the record
        ACustomer.CustomerId = CustomerId; //applied CustomerId to ACustomer to fix the issue
        Found = ACustomer.Find(CustomerId);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtCustomerId.Text           = ACustomer.CustomerId.ToString();
            txtCustomerName.Text         = ACustomer.CustomerName;
            txtCustomerEmail.Text        = ACustomer.CustomerEmail;
            txtCustomerPassword.Text     = ACustomer.CustomerPassword;
            txtCustomerCardNumber.Text   = ACustomer.CustomerCardNumber;
            txtCustomerCreationDate.Text = ACustomer.CustomerCreationDate.ToString();
        }
        else
        {
            txtCustomerId.Text           = "";
            txtCustomerName.Text         = "";
            txtCustomerEmail.Text        = "";
            txtCustomerPassword.Text     = "";
            txtCustomerCardNumber.Text   = "";
            txtCustomerCreationDate.Text = "";
        }
    }
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create new instance of clsCustomer
        clsCustomer ACustomer = new clsCustomer();

        Int32 CustomerId;

        Boolean Found = false;

        //convert customerId textbox to int32 data type
        CustomerId = Convert.ToInt32(txtCustomerID.Text);

        Found = ACustomer.Find(CustomerId);

        //if record exists, update blank textboxes to customer's details
        if (Found == true)
        {
            txtCustomerDOB.Text   = ACustomer.CustomerDOB.ToString();
            txtCustomerEmail.Text = ACustomer.CustomerEmail;
            txtCustomerName.Text  = ACustomer.CustomerName;
        }

        //if not found then open a message box with error message
        else if (Found == false)
        {
            //pop up box shows and displays error message
            lblError.Text = "Record not found";
        }
    }
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create a new instace of customer class
        clsCustomer AnCustomer = new clsCustomer();
        //variable to store the primary key
        Int32 CustomerID;
        //variable to store the result to find operation
        Boolean Found = false;

        //get the primary key entered by the user
        CustomerID = Convert.ToInt32(txtCustomerID.Text);
        //find the record
        Found = AnCustomer.Find(CustomerID);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtCustomerID.Text   = Convert.ToString(AnCustomer.CustomerID);
            txtFirstName.Text    = AnCustomer.FirstName;
            txtLastName.Text     = AnCustomer.LastName;
            txtAddress.Text      = AnCustomer.Address;
            txtMobileNumber.Text = Convert.ToString(AnCustomer.MobileNumber);
            txtDOB.Text          = Convert.ToString(AnCustomer.Date);
        }
    }
    protected void btnDelete1_Click(object sender, EventArgs e)
    {
        //var to store the primary key value of the record to be deleted
        Int32       CustomerID;
        Boolean     Found;
        clsCustomer ACustomer = new clsCustomer();

        if (txtCustomerID.Text != "")
        {
            CustomerID = Convert.ToInt32(txtCustomerID.Text);
            //find the record
            Found = ACustomer.Find(CustomerID);
            //if an id was provided
            if (Found == true & Convert.ToInt32(txtCustomerID.Text) != -1)
            {
                //get the primary key value of the record to delete
                CustomerID = Convert.ToInt32(txtCustomerID.Text);
                //store the data in the sesion object
                Session["CustomerID"] = CustomerID;
                //redirect to the delete page
                Response.Redirect("CustomerDelete.aspx");
            }
        }
        else
        {
            //display an error
            lblError.Text = "Please provide your ID";
        }
    }
    protected void BtnFind_Click(object sender, EventArgs e)
    {
        //create instance of the address class
        clsCustomer AnCustomer = new clsCustomer();
        //variable to store the primary key
        Int32 CustomerNo;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        CustomerNo = Convert.ToInt32(txtCustomerNumber.Text);
        //find the record
        Found = AnCustomer.Find(CustomerNo);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtCustomerName.Text            = AnCustomer.CustomerName;
            txtCustomerEmail.Text           = AnCustomer.CustomerEmail;
            txtCustomerBillingAddress.Text  = AnCustomer.CustomerBillingAddress;
            txtCustomerShippingAddress.Text = AnCustomer.CustomerShippingAddress;
            txtDateWhenJoined.Text          = AnCustomer.DateWhenJoined.ToString();
        }
        else
        {
            lblError.Text = ("That is a invalid customer number");
        }
    }
Esempio n. 9
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsCustomer Customer = new clsCustomer();
        Int32       CustomerId;
        bool        isNumeric = int.TryParse(txtCustomerId.Text, out CustomerId);

        if (!isNumeric)
        {
            lblError.Text = "Provided ID is not a number.";
        }
        else
        {
            Boolean Found = false;
            Found = Customer.Find(CustomerId);

            if (Found == true)
            {
                txtName.Text                = Customer.Name;
                txtEmailAddress.Text        = Customer.EmailAddress;
                txtAddress.Text             = Customer.Address;
                txtPassword.Text            = Customer.Password;
                txtLoyaltyPoints.Text       = Customer.LoyaltyPoints.ToString();
                txtCreatedAt.Text           = Customer.CreatedAt.ToString();
                chkIsEmailConfirmed.Checked = Customer.isEmailConfirmed;
                lblError.Text               = "";
            }
            else
            {
                lblError.Text = "The customer with this ID has not been found.";
            }
        }
    }
Esempio n. 10
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create a new instance of clsCustomer
        clsCustomer ACustomer = new clsCustomer();
        //variable to store the primary key
        Int32 CustomerID;
        //variable to store the result of the find operation
        Boolean Found = false;
        //get the primary key entred by the user
        CustomerID = Convert.ToInt32(txtCustomerID.Text);
        //find the record
        Found = ACustomer.Find(CustomerID);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtEmail.Text = ACustomer.Email;
            txtPassword.Text = ACustomer.Password;
            txtFirstName.Text = ACustomer.FirstName;
            txtSurName.Text = ACustomer.SurName;
            txtGender.Text = ACustomer.Gender;
            txtDateOfBirth.Text = ACustomer.DateOfBirth.ToString();
            txtPhoneNumber.Text = ACustomer.PhoneNumber;
            txtAddress.Text = ACustomer.Address;

        }
    }
    protected void BtnFind_Click(object sender, EventArgs e)
    {
        //create an instance of the customer class
        clsCustomer ACustomer = new clsCustomer();
        //variable to store the primary key
        Int32 CustomerNo;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by user
        CustomerNo = Convert.ToInt32(txtCustomerNo.Text);
        //find the record
        Found = ACustomer.Find(CustomerNo);
        //if found
        if (Found == true)
        {
            //display the values of the properties in the form
            txtFirstName.Text   = ACustomer.FirstName;
            txtSurname.Text     = ACustomer.Surname;
            txtEmail.Text       = ACustomer.Email;
            txtHouseNo.Text     = ACustomer.HouseNo;
            txtStreet.Text      = ACustomer.Street;
            txtTown.Text        = ACustomer.Town;
            txtPostCode.Text    = ACustomer.PostCode;
            txtDateOfBirth.Text = ACustomer.DateOfBirth.ToString();
        }
    }
Esempio n. 12
0
 protected void btnFind_Click(object sender, EventArgs e)
 {
     if (txtCusId.Text != "")
     {
         //create an instance of the customer class
         clsCustomer customer = new clsCustomer();
         //variable to store the primary key
         Int32 customerId;
         //variable to store the result of the find operation
         Boolean found = false;
         //get the primary key entered by the user
         customerId = Convert.ToInt32(txtCusId.Text);
         //find the record
         found = customer.Find(customerId);
         //if found
         if (found == true)
         {
             //display the valies of the properties in the form
             txtCusId.Text           = Convert.ToString(customer.cusId);
             txtCusName.Text         = Convert.ToString(customer.cusName);
             txtCusPassword.Text     = Convert.ToString(customer.cusPassword);
             txtCusCreationDate.Text = Convert.ToString(customer.cusDateRegister);
             txtCusEmail.Text        = Convert.ToString(customer.cusEmail);
             txtCusStatus.Checked    = Convert.ToBoolean(customer.cusAccountStatus);
         }
     }
 }
Esempio n. 13
0
 public void FindCustomerOK()
 {
     clsCustomer anCustomer = new clsCustomer();
     Boolean Found = false;
     Int32 CustomerNo = 1;
     Found = anCustomer.Find(CustomerNo);
     Assert.IsTrue(Found);
 }
Esempio n. 14
0
        public void FindMethodOk()
        {
            clsCustomer newCustomer = new clsCustomer();
            Boolean     found       = false;
            Int32       CustomerNo  = 7;

            found = newCustomer.Find(CustomerNo);
            Assert.IsTrue(found);
        }
Esempio n. 15
0
        public void FindMethodOK()
        {
            clsCustomer Customer   = new clsCustomer();
            Boolean     Found      = false;
            Int32       CustomerNo = 48;

            Found = Customer.Find(CustomerNo);
            Assert.IsTrue(Found);
        }
Esempio n. 16
0
        public void FindMethodOK()
        {
            clsCustomer ACustomer  = new clsCustomer();
            Boolean     Found      = false;
            Int32       CustomerID = 11;

            Found = ACustomer.Find(CustomerID);
            Assert.IsTrue(Found);
        }
Esempio n. 17
0
 public void TestCustomerActiveFound()
 {
     clsCustomer anCustomer = new clsCustomer();
     Boolean Found = false;
     Boolean OK = true;
     Int32 CustomerNo = 1;
     Found = anCustomer.Find(CustomerNo);
     if (anCustomer.CustomerActive != true)
     {
         OK = false;
     }
Esempio n. 18
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //variable to store the results of validation
            Boolean Found      = false;
            Int32   CustomerNo = 5;

            Found = ACustomer.Find(CustomerNo);
            Assert.IsTrue(Found);
        }
Esempio n. 19
0
        public void FindMethodOK()
        {
            clsCustomer ACustomer = new clsCustomer();
            Boolean     Found     = false;
            //assgn the data to the property
            Int32 CustomerID = 6;

            //
            Found = ACustomer.Find(CustomerID);
            //apply the test
            Assert.IsTrue(Found);
        }
Esempio n. 20
0
 public void FindMethodOK()
 {
     //create an instance of the class we want to create
     clsCustomer ACustomer = new clsCustomer();
     //boolean variable to store the reslt ofg the validation
     Boolean Found = false;
     //create sometest data to use wiht the method
     Int32 CustomerID = 1;
     Found = ACustomer.Find(CustomerID);
     //test to see if the relst is true
     Assert.IsTrue(Found);
 }
Esempio n. 21
0
 public void TestCustomerNoFound()
 {
     clsCustomer anCustomer = new clsCustomer();
     Boolean Found = false;
     Boolean OK = true;
     Int32 CustomerNo = 1;
     Found = anCustomer.Find(CustomerNo);
     if (anCustomer.CustomerNo != 1)
     {
         OK = false;
     }
     Assert.IsTrue(OK);
 }
Esempio n. 22
0
        public void FindMethodOK()
        {
            //create an instance of clsCustomer
            clsCustomer ACustomer = new clsCustomer();

            Boolean Found = false;
            //test random ID to see if it finds customer Id
            Int32 CustomerId = 3;

            Found = ACustomer.Find(CustomerId);
            //test to see the correct result
            Assert.IsTrue(Found);
        }
Esempio n. 23
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsCustomer Acustomer = new clsCustomer();
        Int32       CustomerID;
        Boolean     Found = false;

        CustomerID = Convert.ToInt32(TxtCustomerID.Text);
        Found      = Acustomer.Find(CustomerID);
        if (Found == true)
        {
            txtCustomerID.Text = Acustomer.CustomerID;
        }
    }
Esempio n. 24
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use within the method
            Int32 CustomerID = 21;

            Found = AnCustomer.Find(CustomerID);
            //test to see that the result is correct
            Assert.IsFalse(Found);
        }
Esempio n. 25
0
        public void TestCustomerVerifiedFound()
        {
            clsCustomer ACustomer  = new clsCustomer();
            Boolean     Found      = false;
            Boolean     OK         = true;
            Int32       CustomerID = 11;

            Found = ACustomer.Find(CustomerID);
            if (ACustomer.VerifiedAccount != true)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Esempio n. 26
0
        public void TestPhoneNoFound()
        {
            clsCustomer ACustomer  = new clsCustomer();
            Boolean     Found      = false;
            Boolean     OK         = true;
            Int32       CustomerID = 6;

            Found = ACustomer.Find(CustomerID);
            if (ACustomer.CustomerTelephone != "example")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Esempio n. 27
0
        public void TestCustomerIDFound()
        {
            clsCustomer ACustomer  = new clsCustomer();
            Boolean     Found      = false;
            Boolean     OK         = true;
            Int32       CustomerID = 6;

            Found = ACustomer.Find(CustomerID);
            if (ACustomer.CustomerID != 6)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Esempio n. 28
0
        public void TestCustomerDateCreatedFound()
        {
            clsCustomer ACustomer  = new clsCustomer();
            Boolean     Found      = false;
            Boolean     OK         = true;
            Int32       CustomerID = 11;

            Found = ACustomer.Find(CustomerID);
            if (ACustomer.DateCreated != Convert.ToDateTime("16/01/2020"))
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Esempio n. 29
0
        public void FindMethodOK()
        {
            //create an instnce of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            //boolean variable to store the results of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 customerID = 1;

            //invoke the method
            Found = AnCustomer.Find(customerID);
            //test to see that the results is correct
            Assert.IsTrue(Found);
        }
Esempio n. 30
0
        public void TestCustomerUsernameFound()
        {
            clsCustomer ACustomer  = new clsCustomer();
            Boolean     Found      = false;
            Boolean     OK         = true;
            Int32       CustomerID = 11;

            Found = ACustomer.Find(CustomerID);
            if (ACustomer.Username != "test")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }