/// <summary> /// 学生信息 /// </summary> public string StuInformation() { string str = ""; str += " 姓名:" + Name; str += " 性别:" + Sex.ToString(); str += " 年龄:" + Age.ToString(); str += " 身高:" + Height.ToString(); str += " 体重:" + Weight.ToString() + "\n"; return(str); }
public static string Format(this SexType sex) { switch (sex) { case SexType.Male: case SexType.Female: return(sex.ToString()); case SexType.DeclineToAnswer: return("Decline to Answer"); default: throw new Exception($"Unexpected Sex {sex}"); } }
private char GetSexCharBySexType(SexType SexType) { switch (SexType) { case SexType.F: return('F'); case SexType.I: return('I'); case SexType.M: return('M'); case SexType.N: return('N'); default: throw new System.ComponentModel.InvalidEnumArgumentException($"Internal error: Unkown SexType retuned by HI Service of : {SexType.ToString()}"); } }