Manager scoring system and fico Scoring System
// Programmer class (employee class) amespace MyOffice {// programmer class (employee class) public class SE {// employee ID public string ID {get; set ;} // Age public int Age {get; set;} // Name public string Name {get; set;} // Gender public Gender {get; set ;} // popularity value: private int _ Popularity = 0; public int popularity {get {return _ popularity;} set {_ popularity = value ;}} // manager annual score private int _ Score = 0; public int score {get {return _ score;} set {_ score = val Ue ;}}// manager comment private String _ assess = "not evaluated"; public String Assess {get {return _ assess ;}set {_ assess = value ;}} // public string SayHi () // {// string message = string. format ("Hello everyone, I am {0}. I am {1} years old, my employee ID is {2}. My popularity is as high as {3 }! ", This. name, this. age, this. ID, this. popularity); // return message; // }}// project manager class PM {// IDprivate string _ id; public string ID {set {_ id = value ;} get {return _ id; }}// age private int _ Age; public int age {get {return _ age ;} set {if (value >=30 & value <= 100) {_ age = value;} else {_ age = 30 ;}}// name private string _ name; public string Name {get {return _ name;} set {_ name = value ;}}// gender private Ge Nder _ gender; public Gender {get {return _ gender;} set {_ gender = value ;}// qualifications private int _ yearOfExperience; public int YearOfExperience {get {return _ yearOfExperience;} set {_ yearOfExperience = value ;}/// /< returns> </returns> public string SayHi () {string message; message = string. format ("Hello everyone, I am {0}. I am {1} years old. I have {2} years of project management experience. ", This. _ name, this. _ age, this. _ yearOfExperience); return message;} // Project Manager rating // <param name = "se"> </param> public void Judge (SE se, String assess, int score) {se. assess = assess; se. score = score ;}}// Gender enumeration public enum Gender {male, female }}// main form using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. win Dows. forms; namespace MyOffice {public partial class FrmJudge: Form {private FrmShow myParent; // main Form private SE; // The scored employee object public FrmJudge (FrmShow fparent, int index) {InitializeComponent (); this. myParent = fparent; this. se = myParent. engineers [index];} // fill in the private void FrmJudge_Load (object sender, EventArgs e%%this.txt Name. text = se.name+this.txt Assess. text = se.assess#this.txt Score. text = se. sco Re. toString () ;}// rating RESPONSE event private void btnOK_Click (object sender, EventArgs e) {try {PM = new Score. text. trim (); this. myParent. updateView (); // refresh the main form this. close ();} catch (Exception ex) {MessageBox. show ("rating failed! "+ Ex. toString () ;}}// cancel the private void btnCancel_Click (object sender, EventArgs e) {this. close () ;}}/// <summary> // Required designer variable. /// </summary> private System. componentModel. IContainer components = null; // <summary> // Clean up any resources being used. /// </summary> /// <param name = "disposing"> true if managed resources shocould be disposed; otherwise, false. </param> protected override Void Dispose (bool disposing) {if (disposing & (components! = Null) {components. dispose ();} base. dispose (disposing );} # region Windows Form Designer generated code // <summary> // Required method for Designer support-do not modify // the contents of this method with the code editor. /// </summary> private void InitializeComponent () {this. label1 = new System. windows. forms. label (); this. label2 = new System. windows. forms. label (); this. label3 = new System. windows. for Ms.label(~~this.txt Name = new system.windows.forms.textbox(~~this.txt Score = new System. windows. forms. textBox (); this. btnOK = new System. windows. forms. button (); this. btnCancel = new system.windows.forms.button(~~this.txt Assess = new System. windows. forms. textBox (); this. suspendLayout (); // label1 // this. label1.AutoSize = true; this. label1.Location = new System. drawing. point (17, 30); this. label1.Name = "Label1"; this. label1.Size = new System. drawing. size (53, 12); this. label1.TabIndex = 0; this. label1.Text = "employee name"; // label2 // this. label2.AutoSize = true; this. label2.Location = new System. drawing. point (17, 70); this. label2.Name = "label2"; this. label2.Size = new System. drawing. size (53, 12); this. label2.TabIndex = 1; this. label2.Text = "Enter rating"; // label3 // this. label3.AutoSize = true; this. label3.Loca Tion = new System. drawing. points (17,128); this. label3.Name = "label3"; this. label3.Size = new System. drawing. size (53, 12); this. label3.TabIndex = 2; this. label3.Text = "annual score"; // txtName // this.txt Name. location = new System. drawing. point (90, 212.161_this.txt Name. name = "txtName" ;this.txt Name. readOnly = true=this.txt Name. size = new System. drawing. size (212, 21100000000this.txt Name. tabIndex = 3; // txtScore // t His.txt Score. location = new System. drawing. point (90,120 faster than this.txt Score. name = "txtScore" descrithis.txt Score. size = new System. drawing. size (212, 21100000000this.txt Score. tabIndex = 5; // btnOK // this. btnOK. location = new System. drawing. points (90,160); this. btnOK. name = "btnOK"; this. btnOK. size = new System. drawing. size (75, 23); this. btnOK. tabIndex = 7; this. btnOK. text = "rating"; this. btnOK. useVisualStyleBackColor = True; this. btnOK. click + = new System. eventHandler (this. btnOK_Click); // btnCancel // this. btnCancel. location = new System. drawing. points (171,160); this. btnCancel. name = "btnCancel"; this. btnCancel. size = new System. drawing. size (75, 23); this. btnCancel. tabIndex = 8; this. btnCancel. text = "cancel"; this. btnCancel. useVisualStyleBackColor = true; this. btnCancel. click + = new System. eventHandler (this. btnCancel_C Lick); // txtAssess // this.txt Assess. location = new System. drawing. point (90, 611_1_this.txt Assess. multiline = true=this.txt Assess. name = "txtAssess" incluthis.txt Assess. size = new System. drawing. size (217, 53366%this.txt Assess. tabIndex = 9; // FrmJudge // this. autoScaleDimensions = new System. drawing. sizeF (6F, 12F); this. autoScaleMode = System. windows. forms. autoScaleMode. font; this. clientSize = new System. Drawing. size (319,204 bytes Name); this. controls. add (this. label3); this. controls. add (this. label2); this. controls. add (this. label1); this. name = "FrmJudge"; this. text = "rating"; this. load + = new System. eventHandler (this. frmJudge_Load); this. resumeLayout (false); This. extends mlayout () ;}# endregionprivate System. windows. forms. label label1; private System. windows. forms. label label2; private System. windows. forms. label label3; private System. windows. forms. textBox txtName; private System. windows. forms. textBox txtScore; private System. windows. forms. button btnOK; private System. windows. forms. button btnCancel; private System. windows. forms. textBox txtAssess; }}// set of employees publ Ic partial class FrmShow: Form {public SE [] engineers = new SE [3]; // set of employees public FrmShow () {InitializeComponent (); this. init (); // initialize employee set information this. updateView (); // refresh display} // initialize public void Init () {SE jack = new SE (); jack. name = "Wang xiaomao"; jack. age = 26; jack. gender = Gender. male; jack. ID = "111"; SE joe = new SE (); joe. name = "Zhou Xinyu"; joe. age = 22; joe. gender = Gender. female; joe. ID = "112"; SE ema = new SE (); ema. na Me = "Zhang Ye"; ema. age = 30; ema. gender = Gender. male; ema. ID = "113"; engineers [0] = jack; engineers [1] = joe; engineers [2] = ema;} // refresh the ListView display public void UpdateView () {lvAssess. items. clear (); // Clear information for (int I = 0; I <engineers. length; I ++) {ListViewItem item = new ListViewItem (); item. text = engineers [I]. ID; item. subItems. add (engineers [I]. name); // set the Name item. subItems. add (engineers [I]. age. toString (); // set Age item. subItems. add (engineers [I]. score. toString (); // sets the score item. subItems. add (engineers [I]. assess); // set the comment this. lvAssess. items. add (item ); // Add item }}// double-click the execution score // <param name = "sender"> </param> // <param name = "e"> </param> private void lvAssess_DoubleClick (object sender, eventArgs e) {// obtain the currently selected employee object if (this. lvAssess. selectedItems. count = 0) {return;} int index = 0; for (int I = 0; I <engineers. length; I ++) {if (engineer S [I]. ID = this. lvAssess. selectedItems [0]. text. trim () {index = I; break ;}// FrmJudge frm = new FrmJudge (this, index); frm. show () ;}} namespace MyOffice {partial class FrmShow {// Required designer variable. private System. componentModel. IContainer components = null; // Clean up any resources being used. // <param name = "disposing"> true if managed resources shocould be disposed; otherwise, false. </param> p Rotected override void Dispose (bool disposing) {if (disposing & (components! = Null) {components. dispose ();} base. dispose (disposing);} # region Windows Form Designer generated code // Required method for Designer support-do not modify // the contents of this method with the code editor. private void InitiaryalizeComponent () {this. lvAssess = new System. windows. forms. listView (); this. cheaderName = new System. windows. forms. columnHeader (); this. cheaderID = new System. windows. forms. colu MnHeader (); this. cheaderAge = new System. windows. forms. columnHeader (); this. cheaderAsess = new System. windows. forms. columnHeader (); this. cheaderScore = new System. windows. forms. columnHeader (); this. suspendLayout (); // lvAssess // this. lvAssess. columns. addRange (new System. windows. forms. columnHeader [] {this. cheaderID, this. cheaderName, this. cheaderAge, this. cheaderScore, this. cheaderAsess}); this. lvAssess. F UllRowSelect = true; this. lvAssess. gridLines = true; this. lvAssess. location = new System. drawing. point (12, 12); this. lvAssess. name = "lvAssess"; this. lvAssess. size = new System. drawing. size (453,230); this. lvAssess. tabIndex = 0; this. lvAssess. useCompatibleStateImageBehavior = false; this. lvAssess. view = System. windows. forms. view. details; this. lvAssess. doubleClick + = new System. eventHandler (this. lvAssess_D OubleClick); // cheaderName // this. cheaderName. text = "name"; // cheaderID // this. cheaderID. text = "employee ID"; // cheaderAge // this. cheaderAge. text = "Age"; // cheaderAsess // this. cheaderAsess. displayIndex = 3; this. cheaderAsess. text = "rating"; // cheaderScore // this. cheaderScore. displayIndex = 4; this. cheaderScore. text = "annual score"; // FrmShow // this. autoScaleDimensions = new System. drawing. sizeF (6F, 1 2F); this. autoScaleMode = System. windows. forms. autoScaleMode. font; this. clientSize = new System. drawing. size (477,254); this. controls. add (this. lvAssess); this. name = "FrmShow"; this. text = "view score"; this. resumeLayout (false) ;}# endregionprivate System. windows. forms. listView lvAssess; private System. windows. forms. columnHeader cheaderID; private System. windows. forms. columnHeader cheaderName; private System. windo Ws. Forms. ColumnHeader cheaderAge; private System. Windows. Forms. ColumnHeader cheaderAsess; private System. Windows. Forms. ColumnHeader cheaderScore;} // main entry point of the application. Static class Program {[STAThread] static void Main () {Application. EnableVisualStyles (); Application. SetCompatibleTextRenderingDefault (false); Application. Run (new FrmShow ());}}