예제 #1
0
 /// <summary>
 /// 保存一个查房日志到本地
 /// </summary>
 /// <param name="CheckLog"></param>
 public void SaveCheckLogToLocal(Data.DoctorCheckLog CheckLog)
 {//To do:修改病人的同步标志,标识需同步查房日志
     using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(iDB.DbFile))
     {
         string SqlCheckLog                 = @"Select * From [DoctorCheckLog] Where [DCLID]=?";
         SQLite.SQLiteCommand cmd           = conn.CreateCommand(SqlCheckLog, CheckLog.DCLID);
         Data.DoctorCheckLog  existCheckLog = cmd.ExecuteQuery <DoctorCheckLog>().SingleOrDefault();
         Data.SyncLog         slCheckLog    = new SyncLog()
         {
             TableName  = "[DoctorCheckLog]",
             KeyField   = "DCLID",
             KeyValue   = CheckLog.DCLID,
             ChangeType = "INSERT"
         };
         if (existCheckLog == null)
         {
             conn.Insert(CheckLog);
         }
         else
         {
             conn.Update(CheckLog);
             slCheckLog.ChangeType = "UPDATE";
         }
         SaveSyncLog(conn, slCheckLog);
     }
 }
예제 #2
0
        public void ExeShowCheckLogList(List <Data.DoctorCheckLog> LogList)
        {
            if (LogList.FindAll(log => log.CheckDate == iCommon.Today).Count == 0)
            {
                LogList.Insert(0, NewLog());
            }

            var groupData = from log in LogList group log by log.CheckDate;

            this.cvsCheckLog.Source = groupData;
            var DateList = cvsCheckLog.View.CollectionGroups;

            (this.mmSZoom.ZoomedOutView as ListViewBase).ItemsSource = DateList;

            if (logParam != null)
            {
                Data.DoctorCheckLog log = LogList.Find(c => c.DCLID == logParam.DCLID);
                if (log != null)
                {
                    gridLogList.SelectedItem = log;
                }
            }

            if (gridLogList.SelectedItem != null)
            {
                ShowLog(gridLogList.SelectedItem as Data.DoctorCheckLog);
            }
            PatientCheckLog = LogList;
        }
예제 #3
0
 void View_OnUpdateCheckLog(object sender, Views.CheckLogDetailEventArgs e)
 {
     Data.DoctorCheckLog CheckLog = Model.QueryLocalCheckLog(e.DCLID);
     if (CheckLog != null)
     {
         View.ExeUpdateCheckLog(CheckLog);
     }
 }
예제 #4
0
 private void btnDeleteCheckLog_Click(object sender, RoutedEventArgs e)
 {
     if (this.gridLogList.SelectedItem == null)
     {
         return;
     }
     Data.DoctorCheckLog log = gridLogList.SelectedItem as Data.DoctorCheckLog;
     OnDeleteCheckLog(null, new Views.CheckLogDetailEventArgs(iCommon.Patient.InhosID, log));
 }
예제 #5
0
 private void gridLogList_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (gridLogList.SelectedItem == null)
     {
         return;
     }
     Data.DoctorCheckLog log = gridLogList.SelectedItem as Data.DoctorCheckLog;
     ShowLog(log);
 }
예제 #6
0
 private void gridPhotoList_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (gridPhotoList.SelectedItem == null)
     {
         return;
     }
     Data.DoctorCheckLog photo = gridPhotoList.SelectedItem as Data.DoctorCheckLog;
     ShowPhoto(photo);
 }
예제 #7
0
        private async void ShowLog(Data.DoctorCheckLog log)
        {
            if (clDetail.CheckLog != null)
            {
                clDetail.CheckLog.MedicalLog = await GetImage();

                OnSaveCheckLog(null, clDetail);
            }

            SetImage(log.MedicalLog);
            clDetail.CheckLog = log;
        }
예제 #8
0
 private void btnDeletePhoto_Click(object sender, RoutedEventArgs e)
 {
     if (this.gridPhotoList.SelectedItem == null)
     {
         return;
     }
     Data.DoctorCheckLog             photo = gridPhotoList.SelectedItem as Data.DoctorCheckLog;
     Views.CheckPhotoDetailEventArgs arg   = new Views.CheckPhotoDetailEventArgs();
     arg.InhosID    = iCommon.Patient.InhosID;
     arg.CheckPhoto = photo;
     OnDeleteCheckPhoto(null, arg);
 }
예제 #9
0
        async void SaveCheckPhoto(StorageFile ImageFile)
        {
            IBuffer fileBuffer = await FileIO.ReadBufferAsync(ImageFile);

            byte[] btsImage           = WindowsRuntimeBufferExtensions.ToArray(fileBuffer, 0, (int)fileBuffer.Length);
            Data.DoctorCheckLog photo = NewPhoto();
            photo.Photo = btsImage;
            Views.CheckPhotoDetailEventArgs cva = new Views.CheckPhotoDetailEventArgs();
            cva.InhosID    = iCommon.Patient.InhosID;
            cva.CheckPhoto = photo;
            OnSaveCheckPhoto(null, cva);
        }
예제 #10
0
        private async void ShowPhoto(Data.DoctorCheckLog photo)
        {
            var bitmapImage = new BitmapImage();

            using (var stream = new InMemoryRandomAccessStream())
            {
                DataWriter datawriter = new DataWriter(stream.GetOutputStreamAt(0));
                datawriter.WriteBytes(photo.Photo);
                await datawriter.StoreAsync();

                bitmapImage.SetSource(stream);
            }
            imgCheck.Source = bitmapImage;
        }
예제 #11
0
 Data.DoctorCheckLog NewPhoto()
 {
     Data.DoctorCheckLog nLog = new Data.DoctorCheckLog();
     nLog.DCLID        = Guid.NewGuid().ToString();
     nLog.DeviceID     = iCommon.DeviceID;
     nLog.DoctorID     = iCommon.DoctorID;
     nLog.DoctorName   = iCommon.DoctorName;
     nLog.InhosID      = iCommon.Patient.InhosID;
     nLog.LogType      = "照片";
     nLog.CheckDate    = iCommon.Today;
     nLog.CheckTime    = iCommon.NowTime;
     nLog.LastSaveDate = iCommon.DateNow;
     return(nLog);
 }
예제 #12
0
        public void DeleteCheckLog(Data.DoctorCheckLog CheckLog)
        {
            using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(iDB.DbFile))
            {
                string SqlCheckLog       = @"Delete From [DoctorCheckLog] Where [DCLID]=?";
                SQLite.SQLiteCommand cmd = conn.CreateCommand(SqlCheckLog, CheckLog.DCLID);
                cmd.ExecuteNonQuery();
                Data.SyncLog slCheckLog = new SyncLog()
                {
                    TableName  = "[DoctorCheckLog]",
                    KeyField   = "DCLID",
                    KeyValue   = CheckLog.DCLID,
                    ChangeType = "DELETE"
                };

                SaveSyncLog(conn, slCheckLog);
            }
        }
예제 #13
0
 void iCommon_CheckLogSyncComplet(object sender, CheckLogSyncEventArgs e)
 {
     for (int i = 0; i < e.InhosID.Count; i++)
     {
         if (iCommon.Patient.InhosID == e.InhosID[i])
         {//判断是否有当前病人的更新
             string CurrentDCLID = "";
             if (this.gridLogList.SelectedItem != null)
             {
                 CurrentDCLID = (this.gridLogList.SelectedItem as Data.DoctorCheckLog).DCLID;
             }
             int Index = e.DCLID.IndexOf(CurrentDCLID);
             if (Index >= 0 && e.ChangeType[Index] == "UPDATE")
             { //判断是否有当前日志的更新,有则覆盖显示
                 Views.CheckLogDetailEventArgs logArg = new Views.CheckLogDetailEventArgs();
                 logArg.DCLID = CurrentDCLID;
                 OnUpdateCheckLog(null, logArg);
             }
             for (int c = 0; c < e.DCLID.Count; c++)
             {
                 if (e.DCLID[c] == CurrentDCLID)
                 {
                     continue;
                 }
                 Data.DoctorCheckLog checkLog = PatientCheckLog.Find(pcl => pcl.DCLID == e.DCLID[c]);
                 if (checkLog != null)
                 {
                     if (e.ChangeType[c] == "UPDATE")
                     {
                         checkLog.MedicalLog = e.MedicalLog[c];
                     }
                     else if (e.ChangeType[c] == "DELETE")
                     {
                         PatientCheckLog.Remove(checkLog);
                     }
                 }
             }
             return;
         }
     }
 }
예제 #14
0
 public void ExeDeleteCheckLog(Data.DoctorCheckLog CheckLog)
 {
     PatientCheckLog.Remove(CheckLog);
     ExeShowCheckLogList(PatientCheckLog);
 }
예제 #15
0
 public void ExeUpdateCheckLog(Data.DoctorCheckLog CheckLog)
 {
     SetImage(CheckLog.MedicalLog, true);
 }
예제 #16
0
 public void ExeDeleteCheckPhoto(Data.DoctorCheckLog CheckPhoto)
 {
     PatientCheckPhoto.Remove(CheckPhoto);
     ExeShowCheckPhotoList(PatientCheckPhoto);
 }
예제 #17
0
 public void ExeShowCheckPhoto(Data.DoctorCheckLog CheckPhoto)
 {
     PatientCheckPhoto.Insert(0, CheckPhoto);
     ExeShowCheckPhotoList(PatientCheckPhoto);
 }
예제 #18
0
 public CheckLogDetailEventArgs(string inhosID, Data.DoctorCheckLog checkLog)
 {
     InhosID  = inhosID;
     CheckLog = checkLog;
 }