using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FangYar.Model.TRAIN { /// /// 支队单月详情数据查询用户模型 /// public class ORGMonthUserMo { /// /// 用户ID /// public string USERS_UID { get; set; } /// /// 名称 /// public string Name { get; set; } /// /// 性别 /// public string Sex { get; set; } /// /// 生日 /// public string Birthday { get; set; } /// /// 年龄 /// public string Age { get { if (!string.IsNullOrWhiteSpace(Idnumber) && string.IsNullOrWhiteSpace(Birthday)) { if (Idnumber.Length == 18)//处理18位的身份证号码从号码中得到生日和性别代码 { Birthday = Idnumber.Substring(6, 4) + "-" + Idnumber.Substring(10, 2) + "-" + Idnumber.Substring(12, 2); } if (Birthday.Length == 15) { Birthday = "19" + Idnumber.Substring(6, 2) + "-" + Idnumber.Substring(8, 2) + "-" + Idnumber.Substring(10, 2); } } if (!string.IsNullOrWhiteSpace(Birthday)) { DateTime dt; DateTime.TryParse(Birthday, out dt); var age = GetAgeByBirthdate(dt); return age + ""; } return ""; } } /// /// 职务 /// public string Job { get; set; } /// /// 身份证号 /// public string Idnumber { get; set; } private int GetAgeByBirthdate(DateTime birthdate) { DateTime now = DateTime.Now; int age = now.Year - birthdate.Year; if (now.Month < birthdate.Month || (now.Month == birthdate.Month && now.Day < birthdate.Day)) { age--; } return age < 0 ? 0 : age; } } /// /// 支队单月详情数据查询成绩模型 /// public class ORGMothScoreMo { /// /// 用户ID /// public string USERS_UID { get; set; } /// /// 用户名称 /// public string USERS_NAME { get; set; } /// /// 项目ID /// public string SUBJECTID { get; set; } /// /// 项目名称 /// public string SUBJECTNAME { get; set; } /// /// 考核结果 /// public string RESULT { get; set; } /// /// 考核月份 /// public string TIM { get; set; } /// /// 考核得分 /// public double ACHIEVEMENT { get; set; } } /// /// 数据查询返回模型 /// public class ORGMothQueryMo { /// /// 表格结果集 /// public List> tbData = new List>(); /// /// 标题结果集 /// public List colArr = new List(); } public class ORGMothColumnSubMo { /// /// 信息ID /// public string subid { get; set; } /// /// 信息名称 /// public string subname { get; set; } } /// /// 比例信息查询 /// public class ORGMonthRatioMo { /// /// 机构名称 /// public string ORG_NAME { get; set; } /// /// 机构总人数 /// public int ALL_NUM { get; set; } /// /// 用户ID /// public string USERS_UID { get; set; } /// /// 科目名称 /// public string SUBJECTNAME { get; set; } /// /// 科目编码 /// public string EXTENDTWO { get; set; } /// /// 得分 /// public double ACHIEVEMENT { get; set; } } }