Exemple #1
0
        /// <summary>
        /// 更新律师记录
        /// </summary>
        /// <param name="lawyer">律师对象</param>
        internal void UpdateLowyer(Lawyer lawyer)
        {
            if (lawyer.LawyerName == "")
                return;

            Lawyer databaseLawyer = null;
            using (IDataReader reader = DB.Select(DataBases.Lawyer).Where(DataBases.Lawyer.LawyerName == lawyer.LawyerName && DataBases.Lawyer.Sex == lawyer.Sex && DataBases.Lawyer.Job == lawyer.Job).ToDataReader())
            {
                if (reader.Read())
                {
                    databaseLawyer = ReadRow(reader);
                }
            }

            if (databaseLawyer != null)
            {
                if (lawyer.LawyerName != "")
                    databaseLawyer.LawyerName = lawyer.LawyerName;

                if (lawyer.Sex != "")
                    databaseLawyer.Sex = lawyer.Sex;

                if (lawyer.Age != "")
                    databaseLawyer.Age = lawyer.Age;

                if (lawyer.Job != "")
                    databaseLawyer.Job = lawyer.Job;

                databaseLawyer.SystemService = this.SystemService;
                databaseLawyer.SQLtransaction = this.SQLtransaction;
                databaseLawyer.Update();
            }
            else
            {
                lawyer.SystemService = this.SystemService;
                lawyer.SQLtransaction = this.SQLtransaction;
                lawyer.Update();
            }
        }
Exemple #2
0
        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);
        }