コード例 #1
0
        void Add()
        {
            clsCustomerCollection Customers = new clsCustomerCollection();

            Boolean OK = Customers.ThisCustomer.Valid (txtFirstName.Text, txtLastName.Text, txtAddressLine1.Text, txtAddressLine2.Text, txtTown.Text, 
                                                        txtPostCode.Text, txtPhoneNo.Text, txtEmailAddress.Text,txtUserName.Text,txtPassword.Text);

         if (OK == true)
            {
                Customers.ThisCustomer.FirstName = txtFirstName.Text;
                Customers.ThisCustomer.LastName = txtLastName.Text;
                Customers.ThisCustomer.AddressLine1 = txtAddressLine1.Text;
                Customers.ThisCustomer.AddressLine2 = txtAddressLine2.Text;
                Customers.ThisCustomer.Town = txtTown.Text;
                Customers.ThisCustomer.PostCode = txtPostCode.Text;
                Customers.ThisCustomer.EmailAddress = txtEmailAddress.Text;
                Customers.ThisCustomer.PhoneNo = txtPhoneNo.Text;
                Customers.ThisCustomer.UserName = txtUserName.Text;
                Customers.ThisCustomer.Password = txtPassword.Text;


                Customers.Add();
            }
         else
         {
             lblError.Text = "There were problems";
         }
        }
コード例 #2
0
ファイル: CustomerBackEnd.aspx.cs プロジェクト: Tech-E/Tech-E
        void DisplayCustomers()
        {
            clsCustomerCollection Customers = new clsCustomerCollection();

            lstCustomer.DataSource = Customers.CustomerList;

            lstCustomer.DataValueField = "CustomerNo";

            lstCustomer.DataTextField = "UserName";

            lstCustomer.DataBind();

        }