public bool SaveMedicalRecord(CommContracts.MedicalRecord medicalRecord) { using (DAL.HisContext ctx = new DAL.HisContext()) { var temp = new DAL.MedicalRecord(); temp.ID = medicalRecord.ID; temp.NO = medicalRecord.NO; temp.MedicalRecordEnum = (DAL.MedicalRecordEnum)medicalRecord.MedicalRecordEnum; temp.RegistrationID = medicalRecord.RegistrationID; temp.WriteTime = medicalRecord.WriteTime; temp.WriteUserID = medicalRecord.WriteUserID; temp.ContentXml = medicalRecord.ContentXml; ctx.MedicalRecords.Add(temp); try { ctx.SaveChanges(); } #pragma warning disable CS0168 // 声明了变量“ex”,但从未使用过 catch (Exception ex) #pragma warning restore CS0168 // 声明了变量“ex”,但从未使用过 { return(false); } return(true); } }
public string GetClinicMedicalRecord() { CommClient.MedicalRecord myd = new CommClient.MedicalRecord(); CommContracts.MedicalRecord medicalRecord = new CommContracts.MedicalRecord(); if (CurrentRegistration != null) { medicalRecord = myd.GetMedicalRecord(CurrentRegistration.ID); } return(medicalRecord.ContentXml); }
private void mnuFile_SaveFileAs_Click(object sender, RoutedEventArgs e) { //textControl1.Save(TXTextControl.StreamType.MSWord | TXTextControl.StreamType.WordprocessingML); string str = ""; //textControl1.Save(out str,) textControl1.Save(out str, TXTextControl.StringStreamType.RichTextFormat); //MessageBox.Show(str); CommClient.MedicalRecord medicalRecordClient = new CommClient.MedicalRecord(); CommContracts.MedicalRecord medicalRecord = new CommContracts.MedicalRecord(); medicalRecord.ContentXml = str; medicalRecord.RegistrationID = 7; medicalRecord.WriteUserID = 1; medicalRecord.WriteTime = DateTime.Now; medicalRecordClient.SaveMedicalRecord(medicalRecord); }
private void textControl1_Loaded(object sender, RoutedEventArgs e) { textControl1.Focus(); //dsAddresses = new DataSet(); //dsAddresses.ReadXml("data2.xml"); mailMerge1 = new MailMerge(); mailMerge1.TextComponent = textControl1; TXTextControl.LoadSettings ls = new TXTextControl.LoadSettings(); ls.ApplicationFieldFormat = TXTextControl.ApplicationFieldFormat.MSWord; ls.LoadSubTextParts = true; //textControl1.Load("333.docx", StreamType.WordprocessingML, ls); CommClient.MedicalRecord medicalRecordClient = new CommClient.MedicalRecord(); CommContracts.MedicalRecord medicalRecord = medicalRecordClient.GetMedicalRecord(7); textControl1.Load(medicalRecord.ContentXml, TXTextControl.StringStreamType.RichTextFormat); }
private void Button_Click_5(object sender, RoutedEventArgs e) { var vm = this.DataContext as HISGUIDoctorVM; string strXML = "<?xml version=\"1.0\" encoding=\"ISO - 8859 - 1\"?><note>"; foreach (var tem in myTextList) { strXML += "<" + tem.GetTittle() + ">" + tem.GetTextContent() + "</" + tem.GetTittle() + ">"; } strXML += "</note>"; CommContracts.MedicalRecord medicalRecord = new CommContracts.MedicalRecord(); if (vm.CurrentRegistration != null) { medicalRecord.RegistrationID = vm.CurrentRegistration.ID; } medicalRecord.NO = ""; medicalRecord.MedicalRecordEnum = CommContracts.MedicalRecordEnum.MenZhen; if (vm.CurrentUser != null) { medicalRecord.WriteUserID = vm.CurrentUser.ID; } medicalRecord.WriteTime = DateTime.Now; medicalRecord.ContentXml = strXML; bool?result = vm?.SaveClinicMedicalRecord(medicalRecord); if (result.HasValue) { if (result.Value) { MessageBox.Show("保存成功!"); return; } } MessageBox.Show("保存失败!"); }
public CommContracts.MedicalRecord GetMedicalRecord(int RegistrationID) { CommContracts.MedicalRecord medicalRecord = new CommContracts.MedicalRecord(); using (DAL.HisContext ctx = new DAL.HisContext()) { var query = from m in ctx.MedicalRecords where m.RegistrationID == RegistrationID orderby m.WriteTime descending select m; var config = new MapperConfiguration(cfg => { cfg.CreateMap <DAL.MedicalRecord, CommContracts.MedicalRecord>(); }); var mapper = config.CreateMapper(); foreach (var tem in query) { medicalRecord = mapper.Map <CommContracts.MedicalRecord>(tem); break; } } return(medicalRecord); }
public bool SaveClinicMedicalRecord(CommContracts.MedicalRecord medicalRecord) { CommClient.MedicalRecord myd = new CommClient.MedicalRecord(); return(myd.SaveMedicalRecord(medicalRecord)); }