Model-engineering implementation and expansion (Design Mode C #) prototype-Self-Test"

Source: Internet
Author: User

Transferred from: Model-engineering implementation and expansion (Design Mode C)

Http://www.cnblogs.com/callwangxiang/

 

Self-Test

Assume that you complete the serialization of an enterprise reporting dataProgramThe Enterprise Information entity must follow the "Computer Information System Integration Qualification"1The level requirement serializes the information that meets the reporting conditions. Refer to the custom deep replication method described in this chapter to implement prototype objects and pass unit test verification.

For the convenience of examples, "Computer Information System Integration qualifications"1Level requirements are excerpted as follows:

1,At least two items have been completed in the last three years.3000System integration items of more than 10 million RMBContents

2,Number of project managers with Computer Information System Integration not less25The number of senior project managers is not less8Name

 

The example does not review whether the enterprise meets the reporting requirements as a whole, but only filters the class members that meet the reporting requirements. The data structure involved in the example is as follows. Please modify itEnterpriseClass is the prototype:

 

[Serializable]
Class Project
{
///   <Summary>
/// End year
///   </Summary>
Public   Int Endyear { Get ; Set ;}

/// <Summary>
///Project funding Scale (RMB)
/// </Summary>
Public DoubleScale {Get;Set;}
}

[Flags]
Enum Qualificationoptions
{
Assisstant, // Support level
Professional, // Expert Level
Senior, // Advanced and senior
Principal // Director/Director level
}

[Serializable]
Class Certification: icomparable < Certification >
{
Public   String Name { Get ; Set ;}
Public Qualificationoptions qualification { Get ; Set ;}

Public   Int Compareto (certification other)
{
If (Other =   Null ) Throw   New Argumentnullexception ( " Other " );
If ( ! String . Equals (other. Name, name )) Throw   New Notsupportedexception ();
If (Qualification = Other. Qualification) Return   0 ;
Return Qualification > Other. Qualification ?   1 : - 1 ;
}
}

[Serializable]
ClassEmployee
{
Public StringName {Get;Set;}
PublicCertification [] certificates {Get;Set;}
}

[Serializable]
Class Enterprise: iserializable
{
  Public   String Name { Get ; Set ;}
Public Project [] Projects { Get ; Set ;}
Public Employee [] staff { Get ; Set ;}
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.