private void ctrlAdd_Click(object sender, EventArgs e)
        {
            var dlg = new Dlg_RecordPatternSelectSource();

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (dlg.p_SelectedTemplate != null)
                {
                    try
                    {
                        Cl_RecordPattern pattern = new Cl_RecordPattern();
                        pattern.p_ClinicName = Cl_SessionFacade.f_GetInstance().p_Doctor.p_ClinicName;
                        pattern.f_SetDoctor(Cl_SessionFacade.f_GetInstance().p_Doctor);
                        pattern.f_SetTemplate(dlg.p_SelectedTemplate);
                        var dlgPattern = new Dlg_RecordPattern();
                        dlgPattern.p_RecordPattern = pattern;
                        dlgPattern.e_Save         += DlgPattern_e_Save;
                        dlgPattern.ShowDialog(this);
                    }
                    catch (Exception er)
                    {
                        MonitoringStub.Error("Error_Editor", "Не удалось добавить новый патерн", er, null, null);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void f_FormatByPattern(Cl_RecordPattern a_Pattern)
 {
     if (a_Pattern != null)
     {
         Cl_RecordsFacade.f_GetInstance().f_EditRecordFromPattern(m_Record, a_Pattern);
         f_UpdateControls();
         m_Log.f_SetEntity(m_Record);
     }
 }
Exemplo n.º 3
0
 internal void FormatPaternFromRecord(Cl_Record a_Record)
 {
     if (a_Record == null)
     {
         return;
     }
     try
     {
         m_SourceRecord = a_Record;
         Cl_TemplatesFacade.f_GetInstance().f_LoadTemplatesElements(a_Record.p_Template);
         Cl_RecordPattern pattern = Cl_RecordsFacade.f_GetInstance().f_GetNewRecordPattern(a_Record);
         pattern.p_ClinicName = Cl_SessionFacade.f_GetInstance().p_Doctor.p_ClinicName;
         pattern.f_SetDoctor(Cl_SessionFacade.f_GetInstance().p_Doctor);
         this.p_RecordPattern = pattern;
     }
     catch (Exception er)
     {
         MonitoringStub.Error("Error_Editor", "Не удалось сформировать паттерн записей по записи", er, null, null);
     }
 }
Exemplo n.º 4
0
 public void f_SetRecordPattern(Cl_RecordPattern a_RecordPattern)
 {
     m_RecordPattern = a_RecordPattern;
     if (m_RecordPattern != null && m_RecordPattern.p_Template != null)
     {
         try
         {
             Cl_TemplatesFacade.f_GetInstance().f_LoadTemplatesElements(m_RecordPattern.p_Template);
             ctrlDoctorFIO.Text = m_RecordPattern.p_DoctorFIO;
             ctrlName.Text      = m_RecordPattern.p_Name;
             Text     = string.Format("Паттерн записей по шаблону \"{0}\" v{1}", m_RecordPattern.p_Template.p_Name, ConfigurationManager.AppSettings["Version"]);
             m_Record = Cl_RecordsFacade.f_GetInstance().f_GetNewRecord(m_RecordPattern);
             f_UpdateControls();
             m_Log.f_SetEntity(m_Record);
         }
         catch (Exception er)
         {
             MonitoringStub.Error("Error_Editor", "Не удалось установить паттерн записей по шаблону", er, null, null);
         }
     }
 }