示例#1
0
 private MessageXML CreateMessage(Message message)
 {
     MessageXML m = new MessageXML()
     {
         Contents = message.Contents,
         Date = message.Date,
         Patient = CreatePatient(message.Patient),
         Recievers = CreateProList(message.Receivers),
         Sender = CreateUser(message.Sender),
         Title = message.Title
     };
     return m;
 }
示例#2
0
 public void DeleteDoc(Message message, string FilePath)
 {
     DocumentSerializable Documents = DeserializeListDoc(GetPathFile(FilePath));
     List<Message> messages = new List<Message>();
     foreach (var mess in Documents.Messages)
     {
         messages.Add(mess);
     }
     foreach (var mes in messages)
     {
         if (mes.Date == message.Date && mes.Contents == message.Contents && mes.Patient.PatientId == message.Patient.PatientId)
         {
             Documents.Messages.Remove(mes);
         }
     }
     SerializeListDoc(Documents, GetPathFile(FilePath));
 }
示例#3
0
 private void ModifyDoc(Message message, string FilePath)
 {
     DocumentSerializable Documents = DeserializeListDoc(GetPathFile(FilePath));
     foreach(var mes in Documents.Messages)
     {
         if (mes.Date == message.Date && mes.Contents == message.Contents && mes.Patient.PatientId == message.Patient.PatientId)
         {
             Documents.Messages.Remove(mes);
             Documents.Messages.Add(message);
         }
     }
     SerializeListDoc(Documents, GetPathFile(FilePath));
 }
示例#4
0
 private void AddDoc(Message message, string FilePath)
 {
     DocumentSerializable Documents = SeeDocument(FilePath);
     Documents.Messages.Add(message);
     SerializeListDoc(Documents, GetPathFile(FilePath));
 }
示例#5
0
 private void CreateDoc(Message message)
 {
     if (_context.SelectRequest.SelectProfessional(message.Sender.UserId) != null)
     {
         var senderFollow = _context.SelectRequest.SelectOneFollow(message.Patient.PatientId, message.Sender.UserId);
         if (senderFollow != null)
         {
             AddDoc(message, message.Patient.PatientId + "$" + message.Sender.UserId);
         }
     }
     foreach (var receiver in message.Receivers)
     {
         var follow = _context.SelectRequest.SelectOneFollow(message.Patient.PatientId, receiver.ProfessionalId);
         if (follow != null)
         {
             AddDoc(message, message.Patient.PatientId + "$" + receiver.ProfessionalId);
         }
     }
     AddDoc(message, GetPathFile(message.Patient.PatientId.ToString()));
 }
示例#6
0
 public void CreateMessage(List<Professional> Receivers, User Sender, string Title, string Contents, Patient Patient)
 {
     Message m = new Message(Title, Contents, Sender, Receivers, Patient);
     CreateDoc(m);
 }