/// <summary> /// 将界面控件中的值,绑定给关联对象。 /// </summary> private void BindFormlToObject() { jobDetail.JobChineseName = DataValid.GetNullOrString(TxtScheduleChineseName.Text); jobDetail.JobName = DataValid.GetNullOrString(TxtJobIdentity.Text); jobDetail.JobGroup = jobDetail.JobName + "_Group"; jobDetail.JobServiceURL = DataValid.GetNullOrString(TxtServiceAddress.Text); jobDetail.State = GetJobState(); if (ComBoxFreq.SelectedValue == null || string.IsNullOrEmpty(ComBoxFreq.SelectedValue.ToString())) { throw new CustomException("请选择执行频率!", ExceptionType.Warn); } jobDetail.ExecutedFreq = Convert.ToByte(ComBoxFreq.SelectedValue); jobDetail.StartDate = DateTimePickerStart.Value; jobDetail.EndDate = DateTimePickerEnd.Value; jobDetail.IntervalType = GetInterval().Item1; jobDetail.Interval = GetInterval().Item2; jobDetail.Description = DataValid.GetNullOrString(TxtNoteDescription.Text); // 备注说明 }
private void butAdd_Click(object sender, EventArgs e) { FormOperatoryEdit FormOE = new FormOperatoryEdit(new Operatory()); FormOE.IsNew = true; List <Operatory> listOld = new List <Operatory>(); foreach (Operatory op in _listOps) { listOld.Add(op.Copy()); } FormOE.ListOps = _listOps; FormOE.ShowDialog(); if (FormOE.DialogResult == DialogResult.OK) { Operatories.Sync(_listOps, listOld); FillGrid(); DataValid.SetInvalid(InvalidType.Operatories); } }
/// <summary> /// 将界面控件中的值,绑定给关联对象。 /// </summary> private void BindFormlToObject() { dbConfigInfo.EquipmentNum = DataValid.GetNullOrString(TxtEquipmentNum.Text); dbConfigInfo.ServerAddress = DataValid.GetNullOrString(TxtServerIP.Text); dbConfigInfo.DBName = DataValid.GetNullOrString(TxtDBName.Text); dbConfigInfo.UserName = DataValid.GetNullOrString(TxtUserName.Text); dbConfigInfo.Password = DataValid.GetNullOrString(TxtPassword.Text); dbConfigInfo.StoredType = GetStoredType().Item1; dbConfigInfo.PageSize = GetStoredType().Item2; dbConfigInfo.MaxCapacity = GetStoredType().Item3; dbConfigInfo.ServerState = GetServerState(); if (ChkAuthenticatedType.Checked) { dbConfigInfo.AuthenticatedType = (byte)AuthenticatedTypeEnum.Windows; } else { dbConfigInfo.AuthenticatedType = (byte)AuthenticatedTypeEnum.SqlServer; } }
private void ControlDone(object sender, EventArgs e) { //Correct the item orders of all definition categories. List <Def> listDefUpdates = new List <Def>(); foreach (KeyValuePair <DefCat, List <Def> > kvp in Defs.GetDeepCopy()) { for (int i = 0; i < kvp.Value.Count; i++) { if (kvp.Value[i].ItemOrder != i) { kvp.Value[i].ItemOrder = i; listDefUpdates.Add(kvp.Value[i]); } } } listDefUpdates.ForEach(x => Defs.Update(x)); if (_isDefChanged || listDefUpdates.Count > 0) { DataValid.SetInvalid(InvalidType.Defs); } }
private void btnCheckHis_Click(object sender, EventArgs e) { if (txtPatid.Controls[0].Text.Trim().Length != 8) { MessageBox.Show("请输入八位完整住院号"); } else { string IPaddress = "132.147.160.60"; bool flag = DataValid.PingHost(IPaddress, 1000); if (flag == true) { DataTable dt = HisHelp.GetHisInfoByPatID(txtPatid.Controls[0].Text.Trim()); if (dt.Rows.Count == 1) { txtPatid.Controls[0].Text = dt.Rows[0]["BRBH"].ToString(); //住院号 txtBednumber.Controls[0].Text = dt.Rows[0]["CWHM"].ToString(); //床号 txtPatname.Controls[0].Text = dt.Rows[0]["BRXM"].ToString(); //姓名 txtPatage.Controls[0].Text = dt.Rows[0]["RYNL"].ToString(); //年龄 txtPatNation.Controls[0].Text = dt.Rows[0]["dmmc"].ToString(); //名族 txtSex.Controls[0].Text = dt.Rows[0]["BRXB"].ToString(); //性别 cmbKeshi.Text = dt.Rows[0]["ksmc"].ToString(); //科室 //txtSqzd.Controls[0].Text = dt.Rows[0]["SQZD"].ToString(); //txtTSQK.Controls[0].Text = dt.Rows[0]["bz"].ToString(); //txtNssss.Controls[0].Text = dt.Rows[0]["oname"].ToString(); //cmbMZFF.Text = dt.Rows[0]["mzff"].ToString(); } else { MessageBox.Show("无此住院号病人信息,请手动填写完整的住院号及病人的信息!"); } } else { MessageBox.Show("HIS网络连接错误,请检查"); } } }
/// <summary> /// 对管理员(Manager)实例对象,进行数据有效性检查。 /// </summary> /// <param name="manager">管理员(Manager)实例对象</param> public static void CheckValid(Manager manager) { #region 检查各属性是否符合空值约束 #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(manager.Name, 50)) { throw new CustomException("“名称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(manager.LoginName, 50)) { throw new CustomException("“登录名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(manager.Password, 50)) { throw new CustomException("“密码”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(manager.Type, 50)) { throw new CustomException("“类型”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(manager.Role, 50)) { throw new CustomException("“角色”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(manager.Note, 50)) { throw new CustomException("“备注”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对社区医生(Doctor)实例对象,进行数据有效性检查。 /// </summary> /// <param name="doctor">社区医生(Doctor)实例对象</param> public static void CheckValid(Doctor doctor) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(doctor.Name)) { throw new CustomException("“姓名”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(doctor.DoctorId, 50)) { throw new CustomException("“医生编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(doctor.Name, 50)) { throw new CustomException("“姓名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(doctor.ExamNo, 50)) { throw new CustomException("“门诊号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(doctor.Pwd, 50)) { throw new CustomException("“密码”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(doctor.Remarks, 50)) { throw new CustomException("“备注”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对角色权限关联表(PTRoleLink)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pTRoleLink">角色权限关联表(PTRoleLink)实例对象</param> public static void CheckValid(PTRoleLink pTRoleLink) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pTRoleLink.RoleId)) { throw new CustomException("“角色编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTRoleLink.FunctionId)) { throw new CustomException("“功能编号”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pTRoleLink.FunctionId, 50)) { throw new CustomException("“功能编号”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 将界面控件中的值,绑定给关联对象。 /// </summary> private void BindFormlToObject() { if (!DataValid.IsNullOrInt(DrpSex.SelectedValue.ToString())) { throw new CustomException("“性别”的编号,不是一个有效的整数,请您重新输入。"); } if (!DataValid.IsNullOrDateTime(TxtDateOfBirth.Text)) { throw new CustomException("“出生日期”不是一个有效格式的日期,正确格式应为“" + DateTime.Now.ToString("yyyy-MM-dd") + "”,请您重新输入。"); } if (!DataValid.IsNullOrInt(DrpDepartment.SelectedValue.ToString())) { throw new CustomException("“所在部门”的自动编号,不是一个有效的整数,请您重新输入。"); } employee.BadgeId = DataValid.GetNullOrString(TxtBadgeId.Text); // 工号 employee.Name = DataValid.GetNullOrString(TxtName.Text); // 姓名 employee.Sex = Sex.GetDataById(DataValid.GetNullOrInt(DrpSex.SelectedValue.ToString()).Value); // 性别 employee.DateOfBirth = DataValid.GetNullOrDateTime(TxtDateOfBirth.Text); // 出生日期 employee.IDCardId = DataValid.GetNullOrString(TxtIDCardId.Text); // 身份证号 employee.Nationa = DataValid.GetNullOrString(TxtNationa.Text); // 民族 employee.PoliticalLandscape = DataValid.GetNullOrString(TxtPoliticalLandscape.Text); // 政治面貌 employee.MaritalStatus = DataValid.GetNullOrString(TxtMaritalStatus.Text); // 婚姻状况 employee.PlaceOfHouseholdRegistration = DataValid.GetNullOrString(TxtPlaceOfHouseholdRegistration.Text); // 户口所在地 employee.Department = (DataValid.GetNullOrInt(DrpDepartment.SelectedValue.ToString()) != null) ? DepartmentBLL.GetDataById(DataValid.GetNullOrInt(DrpDepartment.SelectedValue.ToString()).Value) : null; // 所在部门 employee.ResidenceAddress = DataValid.GetNullOrString(TxtResidenceAddress.Text); // 现居住住址 employee.GraduateSchool = DataValid.GetNullOrString(TxtGraduateSchool.Text); // 毕业学校 employee.FieldOfStudy = DataValid.GetNullOrString(TxtFieldOfStudy.Text); // 所学专业 employee.GraduationDate = DataValid.GetNullOrString(TxtGraduationDate.Text); // 毕业时间 employee.AcademicQualifications = DataValid.GetNullOrString(TxtAcademicQualifications.Text); // 学历 employee.ContactPhone = DataValid.GetNullOrString(TxtContactPhone.Text); // 联系电话 employee.EmergencyContacts = DataValid.GetNullOrString(TxtEmergencyContacts.Text); // 紧急联系人 employee.EmergencyTelephone = DataValid.GetNullOrString(TxtEmergencyTelephone.Text); // 紧急电话 }
private void btnCheckHis_Click(object sender, EventArgs e) { if (checkmenzhen.Checked == true) { string IPaddress = "192.168.18.89"; bool flag = DataValid.PingHost(IPaddress, 1000); if (flag == true) { DataTable dt = hisdb.GetHISpaibanmenzhen(txtPatid.Controls[0].Text.Trim()); if (dt.Rows.Count > 0) { //txtPatid.Controls[0].Text = dt.Rows[0]["BRBH"].ToString();//住院号 txtBednumber.Controls[0].Text = dt.Rows[0]["INP_NO"].ToString(); //床号 txtPatname.Controls[0].Text = dt.Rows[0]["NAME"].ToString(); //姓名 mzmzdjcs = dt.Rows[0]["CLINIC_VISIT_ID"].ToString(); //txtPatage.Controls[0].Text = dt.Rows[0]["RYNL"].ToString();//年龄 txtPatNation.Controls[0].Text = dt.Rows[0]["NATION"].ToString(); //名族 txtSex.Controls[0].Text = dt.Rows[0]["SEX"].ToString(); //性别 cmbKeshi.Text = dt.Rows[0]["DEPT_NAME"].ToString(); //科室 txtSqzd.Controls[0].Text = dt.Rows[0]["PRELIMINARY_DIAGNOSIS"].ToString(); //txtTSQK.Controls[0].Text = dt.Rows[0]["bz"].ToString(); //txtNssss.Controls[0].Text = dt.Rows[0]["oname"].ToString(); //cmbMZFF.Text = dt.Rows[0]["mzff"].ToString(); } else { MessageBox.Show("无此住院号病人信息,请手动填写完整的住院号及病人的信息!"); } } else { MessageBox.Show("HIS网络连接错误,请检查"); } } else if (checkzhuyuan.Checked == true) { string IPaddress = "192.168.18.89"; bool flag = DataValid.PingHost(IPaddress, 1000); if (flag == true) { DataTable dt = hisdb.GetHISpaibanzhuyuan(txtPatid.Controls[0].Text.Trim()); if (dt.Rows.Count > 0) { //txtPatid.Controls[0].Text = dt.Rows[0]["BRBH"].ToString();//住院号 txtBednumber.Controls[0].Text = dt.Rows[0]["BED_NO"].ToString(); //床号 txtPatname.Controls[0].Text = dt.Rows[0]["NAME"].ToString(); //姓名 mzmzdjcs = txtPatid.Controls[0].Text.Trim(); //住院 txtPatage.Controls[0].Text = dt.Rows[0]["AGE"].ToString(); //年龄 txtPatNation.Controls[0].Text = dt.Rows[0]["NATION"].ToString(); //名族 txtSex.Controls[0].Text = dt.Rows[0]["SEX"].ToString(); //性别 cmbKeshi.Text = dt.Rows[0]["DEPT_NAME"].ToString(); //科室 txtSqzd.Controls[0].Text = dt.Rows[0]["pattmd"].ToString(); //txtTSQK.Controls[0].Text = dt.Rows[0]["bz"].ToString(); //txtNssss.Controls[0].Text = dt.Rows[0]["oname"].ToString(); //cmbMZFF.Text = dt.Rows[0]["mzff"].ToString(); } else { MessageBox.Show("无此住院号病人信息,请手动填写完整的住院号及病人的信息!"); } } else { MessageBox.Show("HIS网络连接错误,请检查"); } } }
/// <summary> /// 对基本组织机构(PTOrg)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pTOrg">基本组织机构(PTOrg)实例对象</param> public static void CheckValid(PTOrg pTOrg) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pTOrg.FatherId)) { throw new CustomException("“上级编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTOrg.LevelId)) { throw new CustomException("“层级序号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTOrg.StateId)) { throw new CustomException("“状态”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pTOrg.FatherId, 50)) { throw new CustomException("“上级编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.LevelId, 50)) { throw new CustomException("“层级序号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.OrgName, 500)) { throw new CustomException("“机构名称”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.StateId, 50)) { throw new CustomException("“状态”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.Alternate1, 50)) { throw new CustomException("“备用1”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.Alternate2, 50)) { throw new CustomException("“备用2”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.Alternate3, 50)) { throw new CustomException("“备用3”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.Alternate4, 500)) { throw new CustomException("“备用4”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTOrg.Alternate5, 500)) { throw new CustomException("“备用5”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对员工信息(Employee)实例对象,进行数据有效性检查。 /// </summary> /// <param name="employee">员工信息(Employee)实例对象</param> public static void CheckValid(Employee employee) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(employee.BadgeId)) { throw new CustomException("“工号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.Name)) { throw new CustomException("“姓名”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.Sex)) { throw new CustomException("“性别”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.DateOfBirth)) { throw new CustomException("“出生日期”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.IDCardId)) { throw new CustomException("“身份证号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.Department)) { throw new CustomException("“所在部门”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.GraduateSchool)) { throw new CustomException("“毕业学校”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.AcademicQualifications)) { throw new CustomException("“学历”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(employee.ContactPhone)) { throw new CustomException("“联系电话”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(employee.BadgeId, 50)) { throw new CustomException("“工号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.Name, 50)) { throw new CustomException("“姓名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.IDCardId, 50)) { throw new CustomException("“身份证号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.Nationa, 50)) { throw new CustomException("“民族”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.PoliticalLandscape, 50)) { throw new CustomException("“政治面貌”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.MaritalStatus, 50)) { throw new CustomException("“婚姻状况”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.PlaceOfHouseholdRegistration, 50)) { throw new CustomException("“户口所在地”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.ResidenceAddress, 50)) { throw new CustomException("“现居住住址”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.GraduateSchool, 50)) { throw new CustomException("“毕业学校”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.FieldOfStudy, 50)) { throw new CustomException("“所学专业”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.GraduationDate, 50)) { throw new CustomException("“毕业时间”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.AcademicQualifications, 50)) { throw new CustomException("“学历”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.ContactPhone, 50)) { throw new CustomException("“联系电话”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.EmergencyContacts, 50)) { throw new CustomException("“紧急联系人”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(employee.EmergencyTelephone, 50)) { throw new CustomException("“紧急电话”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对血压检测类(Pressure)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pressure">血压检测类(Pressure)实例对象</param> public static void CheckValid(Pressure pressure) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pressure.Checkdate)) { throw new CustomException("“检测日期”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pressure.ExamNo)) { throw new CustomException("“门诊号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pressure.CheckID)) { throw new CustomException("“检查号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pressure.Name)) { throw new CustomException("“姓名”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pressure.Check_flag)) { throw new CustomException("“检查标志”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pressure.Status)) { throw new CustomException("“状态”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pressure.ExamNo, 50)) { throw new CustomException("“门诊号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.CheckID, 50)) { throw new CustomException("“检查号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Name, 50)) { throw new CustomException("“姓名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Sex.ToString(), 50)) { throw new CustomException("“性别”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Doctor, 50)) { throw new CustomException("“开单医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.DeviceID, 50)) { throw new CustomException("“设备号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Version, 50)) { throw new CustomException("“版本号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Reserve, 50)) { throw new CustomException("“保留字段”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Hosname, 50)) { throw new CustomException("“医院”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Auditdoctor, 50)) { throw new CustomException("“审核医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str1, 50)) { throw new CustomException("“人员类型”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str2, 50)) { throw new CustomException("“血压单位”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str3, 50)) { throw new CustomException("“身份证号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str4, 50)) { throw new CustomException("“血压级别”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str5, 50)) { throw new CustomException("“结论建议”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str6, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str7, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str8, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str9, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.Str10, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001002_ename, 50)) { throw new CustomException("“收缩压简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001002_cname, 50)) { throw new CustomException("“收缩压全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001002_unit, 50)) { throw new CustomException("“收缩压UNIT”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001003_ename, 50)) { throw new CustomException("“舒张压简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001003_cname, 50)) { throw new CustomException("“舒张压全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001003_unit, 50)) { throw new CustomException("“舒张压UNIT”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001004_ename, 50)) { throw new CustomException("“平均压简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001004_cname, 50)) { throw new CustomException("“平均压全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001004_unit, 50)) { throw new CustomException("“平均压UNIT”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001008_ename, 50)) { throw new CustomException("“脉率简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001008_cname, 50)) { throw new CustomException("“脉率全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pressure.T3001008_unit, 50)) { throw new CustomException("“脉率UNIT”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对高级体检表(AdvancedExamination)实例对象,进行数据有效性检查。 /// </summary> /// <param name="advancedExamination">高级体检表(AdvancedExamination)实例对象</param> public static void CheckValid(AdvancedExamination advancedExamination) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(advancedExamination.Id)) { throw new CustomException("“检查编号”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(advancedExamination.Oral, 50)) { throw new CustomException("“口腔”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Hearing, 50)) { throw new CustomException("“听力”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.FMA, 50)) { throw new CustomException("“运动功能”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Fundus, 50)) { throw new CustomException("“眼底”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Skin, 50)) { throw new CustomException("“皮肤”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Sclera, 50)) { throw new CustomException("“巩膜”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.LN, 50)) { throw new CustomException("“淋巴结”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Lung, 50)) { throw new CustomException("“肺功能”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Heart, 50)) { throw new CustomException("“心脏”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Abdomen, 50)) { throw new CustomException("“腹部”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.LowerExtremityEdema, 50)) { throw new CustomException("“下肢水肿”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.DPAP, 50)) { throw new CustomException("“足背动脉搏动”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Dre, 50)) { throw new CustomException("“肛门指诊”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.FBG, 50)) { throw new CustomException("“空腹血糖”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.U_MTB, 50)) { throw new CustomException("“尿微量蛋白”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.GHb, 50)) { throw new CustomException("“糖化血红蛋白”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.HBsAG, 50)) { throw new CustomException("“乙型肝炎表面抗原”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.ECG, 50)) { throw new CustomException("“心电图”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.XRay, 50)) { throw new CustomException("“胸部X线片”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.BUltrasonic, 50)) { throw new CustomException("“B超”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.CervicalSmear, 50)) { throw new CustomException("“宫颈涂片”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Other, 50)) { throw new CustomException("“其他”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Physical, 50)) { throw new CustomException("“体质”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(advancedExamination.Guidance, 50)) { throw new CustomException("“保健指导意见”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对系统功能列表(PTFunctions)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pTFunctions">系统功能列表(PTFunctions)实例对象</param> public static void CheckValid(PTFunctions pTFunctions) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pTFunctions.Id)) { throw new CustomException("“编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTFunctions.FatherNumber)) { throw new CustomException("“上级编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTFunctions.FunctionName)) { throw new CustomException("“功能名称”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTFunctions.StateId)) { throw new CustomException("“状态”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pTFunctions.Id, 50)) { throw new CustomException("“编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.FatherNumber, 50)) { throw new CustomException("“上级编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.FunctionName, 50)) { throw new CustomException("“功能名称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.FunctionTypeId, 50)) { throw new CustomException("“功能类型”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.FunctionPath, 50)) { throw new CustomException("“路径”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.Description, 500)) { throw new CustomException("“功能描述”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.StateId, 50)) { throw new CustomException("“状态”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.Alternate1, 50)) { throw new CustomException("“备用1”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.Alternate2, 50)) { throw new CustomException("“备用2”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.Alternate3, 50)) { throw new CustomException("“备用3”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.Alternate4, 500)) { throw new CustomException("“备用4”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTFunctions.Alternate5, 500)) { throw new CustomException("“备用5”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } #endregion }
private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { DataValid.Text_Value_Limit(sender, e); }
/// <summary> /// 对配置设置(PTConfig)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pTConfig">配置设置(PTConfig)实例对象</param> public static void CheckValid(PTConfig pTConfig) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pTConfig.Id)) { throw new CustomException("“编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTConfig.Name)) { throw new CustomException("“名称”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTConfig.Type)) { throw new CustomException("“类型”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTConfig.GroupId)) { throw new CustomException("“分组”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTConfig.DefaultValue)) { throw new CustomException("“默认值”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pTConfig.Id, 50)) { throw new CustomException("“编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Name, 50)) { throw new CustomException("“名称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Type, 50)) { throw new CustomException("“类型”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.DefaultValue, 50)) { throw new CustomException("“默认值”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Notes, 500)) { throw new CustomException("“备注”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Alternate1, 50)) { throw new CustomException("“备用1”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Alternate2, 50)) { throw new CustomException("“备用2”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Alternate3, 50)) { throw new CustomException("“备用3”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Alternate4, 500)) { throw new CustomException("“备用4”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfig.Alternate5, 500)) { throw new CustomException("“备用5”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对基础对象名称(YWComment)实例对象,进行数据有效性检查。 /// </summary> /// <param name="yWComment">基础对象名称(YWComment)实例对象</param> public static void CheckValid(YWComment yWComment) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(yWComment.PlanId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.PlanName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.CourseId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.CourseName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.CreateUserName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.CreateUserId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.UpdateUserName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.UpdateUserId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.CreateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.UpdateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.Status)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.Support)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWComment.Oppose)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(yWComment.PlanName, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.CourseName, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.CreateUserName, 20)) { throw new CustomException("“”长度不能超过 20 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.UpdateUserName, 20)) { throw new CustomException("“”长度不能超过 20 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.Content, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.Alternate1, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.Alternate2, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.Alternate3, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.Alternate4, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWComment.Alternate5, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对居民疾病信息(ResidentDiseaseInfo)实例对象,进行数据有效性检查。 /// </summary> /// <param name="residentDiseaseInfo">居民疾病信息(ResidentDiseaseInfo)实例对象</param> public static void CheckValid(ResidentDiseaseInfo residentDiseaseInfo) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(residentDiseaseInfo.Id)) { throw new CustomException("“居民内部编号”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(residentDiseaseInfo.Id, 50)) { throw new CustomException("“居民内部编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.HODA, 50)) { throw new CustomException("“药物过敏史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.EH, 50)) { throw new CustomException("“暴露史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.HBP, 50)) { throw new CustomException("“高血压”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.GDM, 50)) { throw new CustomException("“糖尿病”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.CH, 50)) { throw new CustomException("“冠心病”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.COP, 50)) { throw new CustomException("“慢性阻塞性肺疾病”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.MTC, 50)) { throw new CustomException("“恶性肿瘤”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.Stroke, 50)) { throw new CustomException("“脑卒中”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.SMI, 50)) { throw new CustomException("“重性精神”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.TB, 50)) { throw new CustomException("“结核病”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.Hepatitis, 50)) { throw new CustomException("“肝炎”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.OLID, 50)) { throw new CustomException("“其他法定传染病”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.OD, 50)) { throw new CustomException("“职业病”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.Other, 50)) { throw new CustomException("“其他”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.HistoryOfFather, 50)) { throw new CustomException("“父亲病史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.HistoryOfMother, 50)) { throw new CustomException("“母亲病史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.HistoryOfBrothers, 50)) { throw new CustomException("“兄弟姐妹病史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.HistoryOfChildren, 50)) { throw new CustomException("“子女病史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.GeneticHistory, 50)) { throw new CustomException("“遗传病史”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.Disability, 50)) { throw new CustomException("“残疾情况”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(residentDiseaseInfo.Remarks, 50)) { throw new CustomException("“备注”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对基础对象名称(YWCourseJoin)实例对象,进行数据有效性检查。 /// </summary> /// <param name="yWCourseJoin">基础对象名称(YWCourseJoin)实例对象</param> public static void CheckValid(YWCourseJoin yWCourseJoin) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(yWCourseJoin.CourseId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.CourseName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.PlanId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.Status)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.TeacherName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.TeacherId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.StudentName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.StudentId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCourseJoin.LastTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(yWCourseJoin.CourseName, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.TeacherName, 20)) { throw new CustomException("“”长度不能超过 20 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.StudentName, 20)) { throw new CustomException("“”长度不能超过 20 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.Alternate1, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.Alternate2, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.Alternate3, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.Alternate4, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCourseJoin.Alternate5, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对基本用户信息(PTUsers)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pTUsers">基本用户信息(PTUsers)实例对象</param> public static void CheckValid(PTUsers pTUsers) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pTUsers.UserName)) { throw new CustomException("“用户名”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTUsers.Password)) { throw new CustomException("“密码”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTUsers.OrgId)) { throw new CustomException("“机构编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTUsers.Nickname)) { throw new CustomException("“昵称”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTUsers.StateId)) { throw new CustomException("“状态”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pTUsers.UserName, 50)) { throw new CustomException("“用户名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.Password, 50)) { throw new CustomException("“密码”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.Nickname, 50)) { throw new CustomException("“昵称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.StateId, 50)) { throw new CustomException("“状态”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.Alternate1, 50)) { throw new CustomException("“备用1”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.Alternate3, 50)) { throw new CustomException("“备用3”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.Alternate4, 500)) { throw new CustomException("“备用4”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTUsers.Alternate5, 500)) { throw new CustomException("“备用5”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对配置值(PTConfigValue)实例对象,进行数据有效性检查。 /// </summary> /// <param name="pTConfigValue">配置值(PTConfigValue)实例对象</param> public static void CheckValid(PTConfigValue pTConfigValue) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(pTConfigValue.ConfigItem)) { throw new CustomException("“配置项”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTConfigValue.CurrentValue)) { throw new CustomException("“当前值”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(pTConfigValue.Target)) { throw new CustomException("“适用对象”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(pTConfigValue.ConfigItem, 50)) { throw new CustomException("“配置项”编号长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.CurrentValue, 50)) { throw new CustomException("“当前值”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.Target, 50)) { throw new CustomException("“适用对象”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.Alternate1, 50)) { throw new CustomException("“备用1”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.Alternate2, 50)) { throw new CustomException("“备用2”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.Alternate3, 50)) { throw new CustomException("“备用3”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.Alternate4, 500)) { throw new CustomException("“备用4”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(pTConfigValue.Alternate5, 500)) { throw new CustomException("“备用5”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对基础对象名称(YWExamQuestion)实例对象,进行数据有效性检查。 /// </summary> /// <param name="yWExamQuestion">基础对象名称(YWExamQuestion)实例对象</param> public static void CheckValid(YWExamQuestion yWExamQuestion) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(yWExamQuestion.ExamId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamQuestion.Type)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamQuestion.Pic)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamQuestion.Score)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamQuestion.CreateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamQuestion.UpdateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(yWExamQuestion.Pic, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Chance1, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Chance2, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Chance3, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Chance4, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Chance5, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Content, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.ChanceAnswer, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.ObjectAnswer, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.ObjectPic, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Alternate1, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Alternate2, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Alternate3, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Alternate4, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamQuestion.Alternate5, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
private void ControlDone(object sender, EventArgs e) { string compName = SystemInformation.ComputerName; if (checkSimple.Checked && !PrefC.GetBool(PrefName.EasyHidePrinters)) { Printers.ClearAll(); Printers.RefreshCache(); string printerName = ""; if (comboDefault.SelectedIndex == 0) { printerName = ""; } else { printerName = PrinterSettings.InstalledPrinters[comboDefault.SelectedIndex - 1]; } Printers.PutForSit(PrintSituation.Default, compName, printerName, true); } else { for (int i = 0; i < Enum.GetValues(typeof(PrintSituation)).Length; i++) { //loop through each printSituation string printerName = ""; bool isChecked = false; //PrintSituation sit=PrintSituation.Default; //first: main Default, since not in panel Simple if (i == 0) //printSituation.Default { if (comboDefault.SelectedIndex == 0) { printerName = ""; } else { printerName = PrinterSettings.InstalledPrinters[comboDefault.SelectedIndex - 1]; } } foreach (Control control in panelSimple.Controls) { if (control.GetType() != typeof(ComboBox) && //skip anything but comboBoxes and CheckBoxes control.GetType() != typeof(CheckBox)) { continue; } //so only two controls out of all will be used in each Enum loop if (GetSit(control) != (PrintSituation)i) { continue; } if (control.GetType() == typeof(ComboBox)) { if (((ComboBox)control).SelectedIndex == 0) { printerName = ""; } else { printerName = PrinterSettings.InstalledPrinters[((ComboBox)control).SelectedIndex - 1]; } } else //checkBox { isChecked = ((CheckBox)control).Checked; } } Printers.PutForSit((PrintSituation)i, compName, printerName, isChecked); } } DataValid.SetInvalid(InvalidType.Computers); if (checkSimple.Checked != PrefC.GetBool(PrefName.EasyHidePrinters)) { Prefs.UpdateBool(PrefName.EasyHidePrinters, checkSimple.Checked); DataValid.SetInvalid(InvalidType.Prefs); } Printers.RefreshCache(); //the other computers don't care ComputerPrefs.LocalComputer.ScanDocSelectSource = checkScanDocSelectSource.Checked; ComputerPrefs.LocalComputer.ScanDocShowOptions = radioScanDocShowOptions.Checked; ComputerPrefs.LocalComputer.ScanDocDuplex = checkScanDocDuplex.Checked; ComputerPrefs.LocalComputer.ScanDocGrayscale = checkScanDocGrayscale.Checked; ComputerPrefs.LocalComputer.ScanDocResolution = PIn.Int(textScanDocResolution.Text); ComputerPrefs.LocalComputer.ScanDocQuality = PIn.Byte(textScanDocQuality.Text); ComputerPrefs.Update(ComputerPrefs.LocalComputer); DataValid.SetInvalid(InvalidType.Prefs); }
/// <summary> /// 对体温检测类(Temperature)实例对象,进行数据有效性检查。 /// </summary> /// <param name="temperature">体温检测类(Temperature)实例对象</param> public static void CheckValid(Temperature temperature) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(temperature.Checkdate)) { throw new CustomException("“检查日期”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(temperature.ExamNo)) { throw new CustomException("“门诊号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(temperature.CheckID)) { throw new CustomException("“检查号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(temperature.Name)) { throw new CustomException("“姓名”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(temperature.Check_flag)) { throw new CustomException("“检查标志”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(temperature.Status)) { throw new CustomException("“状态”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(temperature.ExamNo, 50)) { throw new CustomException("“门诊号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.CheckID, 50)) { throw new CustomException("“检查号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Name, 50)) { throw new CustomException("“姓名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Sex.ToString(), 50)) { throw new CustomException("“性别”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Doctor, 50)) { throw new CustomException("“开单医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.DeviceID, 50)) { throw new CustomException("“设备号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Version, 50)) { throw new CustomException("“版本号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Reserve, 50)) { throw new CustomException("“保留字段”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Hosname, 50)) { throw new CustomException("“医院”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Auditdoctor, 50)) { throw new CustomException("“审核医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str1, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str2, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str3, 50)) { throw new CustomException("“身份证号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str4, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str5, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str6, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str7, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str8, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str9, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.Str10, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.T3001007_ename, 50)) { throw new CustomException("“体温简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.T3001007_cname, 50)) { throw new CustomException("“体温全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(temperature.T3001007_unit, 50)) { throw new CustomException("“体温UNIT”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对血氧检测类(BloodOxygen)实例对象,进行数据有效性检查。 /// </summary> /// <param name="bloodOxygen">血氧检测类(BloodOxygen)实例对象</param> public static void CheckValid(BloodOxygen bloodOxygen) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(bloodOxygen.Checkdate)) { throw new CustomException("“检查日期”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(bloodOxygen.ExamNo)) { throw new CustomException("“门诊号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(bloodOxygen.CheckID)) { throw new CustomException("“检查号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(bloodOxygen.Name)) { throw new CustomException("“姓名”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(bloodOxygen.Check_flag)) { throw new CustomException("“检查标记”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(bloodOxygen.Status)) { throw new CustomException("“状态”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(bloodOxygen.ExamNo, 50)) { throw new CustomException("“门诊号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.CheckID, 50)) { throw new CustomException("“检查号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Name, 50)) { throw new CustomException("“姓名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Sex.ToString(), 50)) { throw new CustomException("“性别”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Doctor, 50)) { throw new CustomException("“开单医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.DeviceID, 50)) { throw new CustomException("“设备号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Version, 50)) { throw new CustomException("“版本号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Reserve, 50)) { throw new CustomException("“保留字段”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Hosname, 50)) { throw new CustomException("“医院”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Auditdoctor, 50)) { throw new CustomException("“审核医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str1, 50)) { throw new CustomException("“心电诊断”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str2, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str3, 50)) { throw new CustomException("“身份证号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str4, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str5, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str6, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str7, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str8, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str9, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.Str10, 50)) { throw new CustomException("“冗余”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.T3001005_ename, 50)) { throw new CustomException("“血氧简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.T3001005_cname, 50)) { throw new CustomException("“血氧全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.T3001005_unit, 50)) { throw new CustomException("“血氧UNIT”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.T3001009_ename, 50)) { throw new CustomException("“脉率简称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.T3001009_cname, 50)) { throw new CustomException("“脉率全称”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(bloodOxygen.T3001009_unit, 50)) { throw new CustomException("“UNIT(BPM)”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// Called when input for rule is valid /// </summary> protected virtual void OnDataValid() { DataValid?.Invoke(); }
/// <summary> /// 对基础对象名称(YWCoursePlan)实例对象,进行数据有效性检查。 /// </summary> /// <param name="yWCoursePlan">基础对象名称(YWCoursePlan)实例对象</param> public static void CheckValid(YWCoursePlan yWCoursePlan) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(yWCoursePlan.CourseId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.CourseName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.PlanTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.StartTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.FinishTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.CreateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.UpdateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWCoursePlan.Status)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(yWCoursePlan.CourseName, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Name, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Content, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Type, 10)) { throw new CustomException("“”长度不能超过 10 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Pic, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Video, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Study, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Test, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Alternate1, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Alternate2, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Alternate3, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Alternate4, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWCoursePlan.Alternate5, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对基础体检表(BasicExamination)实例对象,进行数据有效性检查。 /// </summary> /// <param name="basicExamination">基础体检表(BasicExamination)实例对象</param> public static void CheckValid(BasicExamination basicExamination) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(basicExamination.Id)) { throw new CustomException("“编号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(basicExamination.ResidentId)) { throw new CustomException("“居民号”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(basicExamination.CheckID)) { throw new CustomException("“体检编号”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(basicExamination.ResidentId, 50)) { throw new CustomException("“居民号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.TheName, 50)) { throw new CustomException("“姓名”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.CheckID, 50)) { throw new CustomException("“体检编号”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.CheckDate, 50)) { throw new CustomException("“体检日期”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.Doctor, 50)) { throw new CustomException("“体检医生”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.PhysicalExercise, 50)) { throw new CustomException("“体育锻炼”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.Smoking, 50)) { throw new CustomException("“吸烟情况”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.Drinking, 50)) { throw new CustomException("“饮酒情况”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(basicExamination.OccupationalExposure, 50)) { throw new CustomException("“职业暴露情况”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }
/// <summary> /// 对基础对象名称(YWExamAnswer)实例对象,进行数据有效性检查。 /// </summary> /// <param name="yWExamAnswer">基础对象名称(YWExamAnswer)实例对象</param> public static void CheckValid(YWExamAnswer yWExamAnswer) { #region 检查各属性是否符合空值约束 if (DataValid.IsNull(yWExamAnswer.ExamId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.QuestionId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.Type)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.Score)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.CreateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.UpdateTime)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.CreateUserName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.CreateUserId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.UpdateUserName)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } if (DataValid.IsNull(yWExamAnswer.UpdateUserId)) { throw new CustomException("“”不能为空,请您确认输入是否正确。"); } #endregion #region 检查字符串是否超出规定长度 if (DataValid.IsOutLength(yWExamAnswer.ChanceAnswer, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.ObjectAnswer, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.ObjectPic, 500)) { throw new CustomException("“”长度不能超过 500 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.CreateUserName, 20)) { throw new CustomException("“”长度不能超过 20 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.UpdateUserName, 20)) { throw new CustomException("“”长度不能超过 20 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.Alternate1, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.Alternate2, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.Alternate3, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.Alternate4, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } if (DataValid.IsOutLength(yWExamAnswer.Alternate5, 50)) { throw new CustomException("“”长度不能超过 50 个汉字或字符,请您确认输入是否正确。"); } #endregion }