/// <summary> /// 根据名称更新违法行为 /// </summary> /// <param name="illegalType">违法行为对象</param> internal void UpdateIllegalTypeByName(IllegalType illegalType) { IllegalType databaseIllegalType = null; using (IDataReader reader = DB.Select(DataBases.IllegalType).Where(DataBases.IllegalType.TypeName == illegalType.TypeName).ToDataReader()) { if (reader.Read()) { databaseIllegalType = ReadRow(reader); } } if (databaseIllegalType != null) { if (illegalType.TypeName != "") databaseIllegalType.TypeName = illegalType.TypeName; databaseIllegalType.SystemService = this.SystemService; databaseIllegalType.SQLtransaction = this.SQLtransaction; databaseIllegalType.Update(); } else { illegalType.SystemService = this.SystemService; illegalType.SQLtransaction = this.SQLtransaction; illegalType.Update(); } }
private void SaveData() { if (putOnRecord == null) { putOnRecord = new PutOnRecord(); putOnRecord.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(putOnRecord); Company company = new Company { CompanyName = CompanyName.Text, CompanyAddress = PeopleAddress.Text, CompanyPost = PeopleZip.Text, Tel = PeoplePhone.Text }; InvokeUtil.SystemService.UpdateCompanyByName(company); IllegalType illegalType = new IllegalType { TypeName = IllegalTypeName.Text, }; InvokeUtil.SystemService.UpdateIllegalTypeByName(illegalType); CaseSource caseSource = new CaseSource { SourceName = CaseSourceName.Text, }; InvokeUtil.SystemService.UpdateCaseSourceByName(caseSource); InvokeUtil.SystemService.EntityUpdate(putOnRecord); }