/// <summary> /// 更新自然人 /// </summary> /// <param name="person">自然人</param> internal void UpdateNaturalPersonByArgs(NaturalPerson person) { if (person.PersonName == "") return; NaturalPerson databaseNaturalPersone = null; using (IDataReader reader = DB.Select(DataBases.NaturalPerson).Where(DataBases.NaturalPerson.PersonName == person.PersonName && DataBases.NaturalPerson.IDcard == person.IDcard).ToDataReader()) { if (reader.Read()) { databaseNaturalPersone = ReadRow(reader); } } if (databaseNaturalPersone != null) { if (person.Sex != "") databaseNaturalPersone.Sex = person.Sex; if (person.Age != "") databaseNaturalPersone.Age = person.Age; if (person.Address != "") databaseNaturalPersone.Address = person.Address; if (person.CompanyName != "") databaseNaturalPersone.CompanyName = person.CompanyName; if (person.Job != "") databaseNaturalPersone.Job = person.Job; if (person.CompanyAddress != "") databaseNaturalPersone.CompanyAddress = person.CompanyAddress; if (person.CompanyTel != "") databaseNaturalPersone.CompanyTel = person.CompanyTel; databaseNaturalPersone.SystemService = this.SystemService; databaseNaturalPersone.SQLtransaction = this.SQLtransaction; databaseNaturalPersone.Update(); } else { person.SystemService = this.SystemService; person.SQLtransaction = this.SQLtransaction; person.Update(); } }
private void buttonOK_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (administrativePenaltyPerson == null) administrativePenaltyPerson = new AdministrativePenaltyPerson(); GetEntity(administrativePenaltyPerson); NaturalPerson naturalPerson = new NaturalPerson { PersonName = SentPeople.Text, Sex = SentSex.Text, Age = SentAge.Text, IDcard = SentIDCard.Text, Address = SentAddress.Text, CompanyName = SentCompany.Text, Job = SentJob.Text, CompanyAddress = SentCompanyAddress.Text, CompanyTel = SentTel.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); Bank bank = new Bank { BankName = PaymentAddress.Text, Account = PaymentAccount.Text }; InvokeUtil.SystemService.UpdateBankByNameAccount(bank); InvokeUtil.SystemService.EntityUpdate(administrativePenaltyPerson); CloseWindow(); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
private void buttonOK_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (enquireQuestion == null) { enquireQuestion = new EnquireQuestion(); enquireQuestion.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(enquireQuestion); NaturalPerson naturalPerson = new NaturalPerson { Sex = EnquirePersonSex.Text, Age = EnquirePersonAge.Text, IDcard = EnquirePersonIDC.Text, CompanyName = EnquirePersonUnit.Text, Job = EnquirePersonJob.Text, CompanyAddress = EnquirePersonAddress.Text, CompanyTel = EnquirePersonTel.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); List<AskAndAnswer> Answers = questionContainer.GetItems(); enquireQuestion.Items.Clear(); foreach (AskAndAnswer answer in Answers) { enquireQuestion.Items.Add(new EnquireQuestionItem { Anwser = answer.Answer, Question = answer.Question }); } InvokeUtil.SystemService.EntityUpdate(enquireQuestion); OnNavigationRequest(new Maleos.NavigationRequestEventArgs("EnforceForm.frmEnquireQuestions")); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
private void SaveData() { if (spotPunishmentDecisionPersonal == null) { spotPunishmentDecisionPersonal = new SpotPunishmentDecisionPersonal(); spotPunishmentDecisionPersonal.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(spotPunishmentDecisionPersonal); NaturalPerson naturalPerson = new NaturalPerson { Sex = FieldEPeopleSex.Text, Age = FieldEPeopleAge.Text, CompanyTel = FieldEPeoplePhone.Text, Address = FieldEPeopleAddress.Text, CompanyName = FieldEPeopleCompanyName.Text, Job = FieldEPeoplePosition.Text, CompanyAddress = FieldEPeopleCompanyAddress.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); Bank bank = new Bank { BankName = BankName.Text, Account = BankID.Text }; InvokeUtil.SystemService.UpdateBankByNameAccount(bank); InvokeUtil.SystemService.EntityUpdate(spotPunishmentDecisionPersonal); }
private void SaveData() { if (interrogationRecord == null) { interrogationRecord = new InterrogationRecord(); interrogationRecord.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } ToTime.Value = DateTime.Parse(BeganTime.Value.ToString("yyyy-MM-dd") + ToTime.Value.ToString(" HH:mm:ss")); GetEntity(interrogationRecord); NaturalPerson naturalPerson = new NaturalPerson { PersonName = BeAskEPeopleName.Text, Sex = BeAskEPeopleSex.Text, Age = BeAskEPeopleAge.Text, IDcard = BeAskEPeopleID.Text, CompanyName = BeAskEPeopleCompanyName.Text, Address = BeAskEPeopleAddress.Text, CompanyTel = BeAskEPeoplePhone.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); Officers officer1 = new Officers { OfficersName = AskUserName.Text, Unit = AskUserCompanyName.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer1); Officers officer2 = new Officers { OfficersName = RecordUserName.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer2); List<AskAndAnswer> Answers = questionContainer.GetItems(); interrogationRecord.Items.Clear(); foreach (AskAndAnswer answer in Answers) { interrogationRecord.Items.Add(new EnquireQuestionItem { Anwser = answer.Answer, Question = answer.Question }); } InvokeUtil.SystemService.EntityUpdate(interrogationRecord); //InvokeUtil.SystemService.EntityUpdate(enquireQuestion); }
private void SaveData() { if (punishmentDecisionPersonal == null) punishmentDecisionPersonal = new PunishmentDecisionPersonal(); GetEntity(punishmentDecisionPersonal); NaturalPerson naturalPerson = new NaturalPerson { Sex = FieldEPeopleSex.Text, Age = FieldEPeopleAge.Text, CompanyTel = FieldEPeoplePhone.Text, Address = FieldEPeopleAddress.Text, CompanyName = FieldEPeopleCompanyName.Text, Job = FieldEPeoplePosition.Text, CompanyAddress = FieldEPeopleCompanyAddress.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); InvokeUtil.SystemService.EntityUpdate(punishmentDecisionPersonal); }
private void SaveData() { if (sampling == null) { sampling = new Sampling(); sampling.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } sampling.Items.Clear(); foreach (DataGridViewRow row in SamplingContentGridViewItems.Rows) { if (row.Tag != null) sampling.Items.Add(row.Tag as SamplingContent); } ToTime.Value = DateTime.Parse(BeganTime.Value.ToString("yyyy-MM-dd") + ToTime.Value.ToString(" HH:mm:ss")); GetEntity(sampling); Company company = new Company { CompanyName = FieldECompanyName.Text, CompanyAddress = FieldEAddress.Text, Mobile = FieldEPeoplePhone.Text, CompanyPost = FieldEPeopleZio.Text }; InvokeUtil.SystemService.UpdateCompanyByName(company); NaturalPerson naturalPerson = new NaturalPerson { PersonName = FieldEPeopleName.Text, CompanyName = FieldECompanyName.Text, CompanyAddress = FieldEAddress.Text, CompanyTel = FieldEPeoplePhone.Text, }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); NaturalPerson naturalPerson1 = new NaturalPerson { PersonName = WitnesEPeopleName1.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson1); NaturalPerson naturalPerson2 = new NaturalPerson { PersonName = WitnesEPeopleName2.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson2); Officers officer1 = new Officers { OfficersName = ExecUserName1.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer1); Officers officer2 = new Officers { OfficersName = ExecUserName1.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer2); InvokeUtil.SystemService.EntityUpdate(sampling); }
private void SaveData() { if (putDown == null) { putDown = new PutDown(); putDown.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(putDown); Officers officer1 = new Officers { OfficersName = Investigador1.Text, Position = InvestigadorIDC1.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer1); Officers officer2 = new Officers { OfficersName = Investigador2.Text, Position = InvestigadorIDC2.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer2); Company company = new Company { CompanyName = ProposerCompany.Text, CompanyAddress = ProposerAddress.Text, JuridicalPerson = LegalRepre.Text, JuridicalPersonSex = LegalRepreSex.Text, JuridicalPersonAge = LegalRepreAge.Text, }; InvokeUtil.SystemService.UpdateCompanyByName(company); Lawyer legalRepreAgent1 = new Lawyer { LawyerName = LegalRepreAgent1.Text, Sex = LegalRepreAgentSex1.Text, Age = LegalRepreAgentAge1.Text, Job = LegalRepreAgentJob1.Text }; InvokeUtil.SystemService.UpdateLawyer(legalRepreAgent1); Lawyer legalRepreAgent2 = new Lawyer { LawyerName = LegalRepreAgent2.Text, Sex = LegalRepreAgentSex2.Text, Age = LegalRepreAgentAge2.Text, Job = LegalRepreAgentJob2.Text }; InvokeUtil.SystemService.UpdateLawyer(legalRepreAgent2); NaturalPerson person = new NaturalPerson { PersonName = Proposer.Text, Sex = ProposerSex.Text, Age = ProposerAge.Text, Job = ProposerJob.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(person); Lawyer proposerAgent1 = new Lawyer { LawyerName = ProposerAgent1.Text, Sex = ProposerAgentSex1.Text, Age = ProposerAgentAge1.Text, Job = ProposerAgentJob1.Text }; InvokeUtil.SystemService.UpdateLawyer(proposerAgent1); Lawyer proposerAgent2 = new Lawyer { LawyerName = ProposerAgen2.Text, Sex = ProposerAgentSex2.Text, Age = ProposerAgentAge2.Text, Job = ProposerAgentJob2.Text }; InvokeUtil.SystemService.UpdateLawyer(proposerAgent2); InvokeUtil.SystemService.EntityUpdate(putDown); }