private void gridView1_DoubleClick(object sender, EventArgs e)
 {
     if (_PatientMedicament_ViewBE == null) return;
     using (frmAddMedicament frm = new frmAddMedicament())
     {
         frm.State = Fwk.Bases.EntityUpdateEnum.NONE;
         frm._PatientMedicament = _PatientMedicament_ViewBE;
         frm.Refresh();
         frm.ShowDialog();
     }
 }
        private void btnAddMedicamento_Click(object sender, EventArgs e)
        {
            using (frmAddMedicament frm = new frmAddMedicament())
            {
                frm.State = Fwk.Bases.EntityUpdateEnum.NEW;
                frm._PatientMedicament = new PatientMedicament_ViewBE();
                frm._PatientMedicament.ApellidoProfesional = ServiceCalls.CurrentProfesional.Persona.Apellido;
                frm._PatientMedicament.NombreProfesional   = ServiceCalls.CurrentProfesional.Persona.Nombre;
                frm._PatientMedicament.PatientId           = ServiceCalls.CurrentPatient.PatientId;
                frm.currentMedicalEventId = currentEvent.MedicalEventId;

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    //para nuevos medicamentos se le asignan numero negativos incrementales de -1,-2 a -x
                    int count = currentEvent.PatientMedicaments.Count(p => p.PatientMedicamentId < 0);
                    frm._PatientMedicament.PatientMedicamentId = -(count + 1);
                    currentEvent.PatientMedicaments.Add(frm._PatientMedicament);
                    gridView_Medicaments.RefreshData();
                }
            }
        }
        private void btnAddMedicamento_Click(object sender, EventArgs e)
        {
            using (frmAddMedicament frm = new frmAddMedicament())
            {
                frm.State = Fwk.Bases.EntityUpdateEnum.NEW;
                frm._PatientMedicament = new PatientMedicament_ViewBE();
                frm._PatientMedicament.ApellidoProfesional = ServiceCalls.CurrentProfesional.Persona.Apellido;
                frm._PatientMedicament.NombreProfesional = ServiceCalls.CurrentProfesional.Persona.Nombre;
                frm._PatientMedicament.PatientId = ServiceCalls.CurrentPatient.PatientId;
                frm.currentMedicalEventId = currentEvent.MedicalEventId;

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    //para nuevos medicamentos se le asignan numero negativos incrementales de -1,-2 a -x
                    int count = currentEvent.PatientMedicaments.Count(p => p.PatientMedicamentId < 0);
                    frm._PatientMedicament.PatientMedicamentId = -(count + 1);
                    currentEvent.PatientMedicaments.Add(frm._PatientMedicament);
                    gridView_Medicaments.RefreshData();
                }

            }
        }