Beispiel #1
0
        /// <summary>
        /// 根据名称更新案件来源
        /// </summary>
        /// <param name="caseSource">案件来源对象</param>
        internal void UpdateCaseSourceByName(CaseSource caseSource)
        {
            if (caseSource.SourceName == "")
                return;

            CaseSource databaseCaseSource = null;
            using (IDataReader reader = DB.Select(DataBases.CaseSource).Where(DataBases.CaseSource.SourceName == caseSource.SourceName).ToDataReader())
            {
                if (reader.Read())
                {
                    databaseCaseSource = ReadRow(reader);
                }
            }

            if (databaseCaseSource != null)
            {
                if (caseSource.SourceName != "")
                    databaseCaseSource.SourceName = caseSource.SourceName;
                databaseCaseSource.SystemService = this.SystemService;
                databaseCaseSource.SQLtransaction = this.SQLtransaction;
                databaseCaseSource.Update();
            }
            else
            {
                caseSource.SystemService = this.SystemService;
                caseSource.SQLtransaction = this.SQLtransaction;
                caseSource.Update();
            }
        }
Beispiel #2
0
        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);
        }