tailieunhanh - ASP.NET 2.0 Everyday Apps For Dumies 2006 phần 6

Tham khảo tài liệu ' everyday apps for dumies 2006 phần 6', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 196 Part III Building E-Commerce Applications Listing 6-13 continued return _state set _state value public string ZipCode 9 get return _zipCode set _zipCode value public string Email 10 get return _email set _email value public string PhoneNumber 11 get return _phoneNumber set _phoneNumber value The following paragraphs define each component of this class 1 The class begins by defining private instance variables that are used to hold the values associated with the class properties. By convention each of these variable names begins with an Chapter 6 Building a Shopping Cart Application 197 underscore to indicate that it corresponds to a property with the same name. 2 The default constructor creates a Customer object with default values for each of its properties. 3 This constructor accepts arguments that initialize the customer data. Notice that the assignment statements don t directly assign values to the instance variables of the class. Instead they use the properties to assign these values. That way any validation routines written in the property setters will be used. In this example none of the property setters have validation routines. Still it s a good practice to follow just in case. 4 The LastName property represents the customer s last name. Its get routine simply returns the value of the _lastName instance variable and its set routine simply sets the _lastName variable to the value passed via the value argument. 5 The FirstName property represents the customer s first name which is stored in the _firstName instance variable. 6 The Address property represents the customer s address stored in the _address instance variable. 7 The City property represents the customer s city stored in the _city instance variable. 8 The State property represents the customer s state stored in the _state instance variable. 9 The ZipCode property represents the customer s Zip code stored in the _zipCode instance variable. 10 The Email property represents the customer s e-mail .

TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.