Ejemplo n.º 1
0
        //Lorsque l'index de la checkbox change : met à jour les informations de ucMedicament1
        private void cbxMed1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbxMed1.SelectedIndex != -1)
            {
                MEDICAMENT m = (MEDICAMENT)cbxMed1.SelectedItem;
                ucMedicament1.LeMedicament        = m;
                ucMedicament1.Visible             = true;
                checkBox_afficher_rapport.Visible = true;

                List <RAPPORT_VISITE> lesRapports = Manager.ChargerRapportVisiteurAvecMedicament(this.idVisiteur, m.MED_DEPOTLEGAL);
                List <string>         lesNumRap   = new List <string>();
                foreach (RAPPORT_VISITE rv in lesRapports)
                {
                    lesNumRap.Add(rv.RAP_NUM.ToString());
                }

                if (lesNumRap.Count() == 0)
                {
                    btn_choisirRapport.Enabled = false;
                }
                else
                {
                    btn_choisirRapport.Enabled = true;
                }

                bsRapport1.DataSource = lesNumRap;
            }
        }
Ejemplo n.º 2
0
        //Le formulaire prend en paramètre le depot legal du medicament dont il est question
        public FrmDetailsMedicament(string depotLegal)
        {
            InitializeComponent();
            MEDICAMENT med = Manager.ChargerLeMedicament(depotLegal);

            ucMedicament1.LeMedicament = med;
        }
Ejemplo n.º 3
0
        private void btnVoirMed2_Click(object sender, EventArgs e)
        {
            MEDICAMENT m    = Manager.ChargerLeMedicament(txtMed2.Text);
            string     text = " Depot légal : " + m.MED_DEPOTLEGAL + "\n Nom commercial : " + m.MED_NOMCOMMERCIAL + "\n Composition : " + m.MED_COMPOSITION + "\n Effets : "
                              + m.MED_EFFETS + "\n Contre indication : " + m.MED_CONTREINDIC;

            MessageBox.Show(text);
        }
Ejemplo n.º 4
0
 public FrmConsulterMedoc(string mat, MEDICAMENT med1)
 {
     InitializeComponent();
     bsMedicament.DataSource     = VisiteurManager.ChargerMedicaments();
     cbxMedicament.DataSource    = bsMedicament;
     cbxMedicament.DisplayMember = "MED_NOMCOMMERCIAL";
     this.mat = mat;
     bsMedicament.Position = bsMedicament.IndexOf(bsMedicament.List.OfType <MEDICAMENT>().ToList().Find(findPra => findPra.MED_NOMCOMMERCIAL == med1.MED_NOMCOMMERCIAL));
 }
Ejemplo n.º 5
0
 public FrmDetailMedicament(MEDICAMENT Medoc, string mat)
 {
     InitializeComponent();
     this.Medoc = Medoc;
     this.mat   = mat;
     bsRapportMed.DataSource  = VisiteurManager.GetRapportValideByMedoc(Medoc.MED_DEPOTLEGAL, mat);
     dgvRapportMed.DataSource = bsRapportMed;
     txtBoxMed.Text           = Medoc.MED_NOMCOMMERCIAL;
 }
Ejemplo n.º 6
0
        private void btnVoirMedoc_Click(object sender, EventArgs e)
        {
            MEDICAMENT m = Manager.ChargerLeMedicament(txtMed1.Text);

            txtCompo.Text      = m.MED_COMPOSITION;
            txtCodeFam.Text    = m.FAM_CODE;
            txtContrIndic.Text = m.MED_CONTREINDIC;
            txtEffet.Text      = m.MED_EFFETS;
        }
Ejemplo n.º 7
0
 private void cbxMedoc_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbxMedoc.SelectedIndex != -1)
     {
         MEDICAMENT m = (MEDICAMENT)cbxMedoc.SelectedItem;
         ucMedicament1.LeMedicament = m;
         ucMedicament1.Visible      = true;
     }
 }
Ejemplo n.º 8
0
 private void cbxMedoc_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbxMedoc.SelectedIndex != -1)
     {
         MEDICAMENT m = (MEDICAMENT)cbxMedoc.SelectedItem;
         ucMedicament1.LeMedicament = m;
         ucMedicament1.Visible      = true;
     }
     ucMedicament1.BringToFront();
     label1.Visible = false;
     titre.Visible  = true;
 }
Ejemplo n.º 9
0
        public frmInfoMedicament(string codeMedoc)
        {
            InitializeComponent();
            MEDICAMENT m = Manager.ChargerLeMedicament(codeMedoc);

            txtNomCommercial.Text = m.MED_NOMCOMMERCIAL;
            txtMed1.Text          = m.MED_DEPOTLEGAL;
            txtEffet.Text         = m.MED_EFFETS;
            txtCompo.Text         = m.MED_COMPOSITION;
            txtContrIndic.Text    = m.MED_CONTREINDIC;
            txtCodeFam.Text       = m.FAM_CODE;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Retourne une liste de rapport en fonction d'un medicament et d'un visiteur
        /// </summary>
        /// <param name="v"></param>
        /// <param name="m"></param>
        /// <returns></returns>
        public List <RAPPORT_VISITE> FindByMedicament(VISITEUR v, MEDICAMENT m)
        {
            List <RAPPORT_VISITE> lrv = null;

            using (var context = new GSB_visite_LEGUILLIEREntities())
            {
                var req = from rv in context.RAPPORT_VISITE
                          where (rv.RAP_MED1 == m.MED_DEPOTLEGAL || rv.RAP_MED2 == m.MED_DEPOTLEGAL) && rv.RAP_MATRICULE == v.VIS_MATRICULE
                          select rv;
                lrv = req.ToList <RAPPORT_VISITE>();
            }
            return(lrv);
        }
Ejemplo n.º 11
0
 private void Button_Click_6(object sender, RoutedEventArgs e)
 {
     try
     {
         string     firstSelectedCellContent = ((TextBlock)(this.DgridMedicament.Columns[0].GetCellContent(DgridMedicament.SelectedItem))).Text;
         MEDICAMENT name     = dbContext.MEDICAMENTs.First(m => m.M_NAME == firstSelectedCellContent);
         AddForm    editForm = new AddForm(name, this);
         editForm.Show();
     }
     catch (Exception)
     {
         MessageBox.Show("Выделите строку, которую хотите редактировать");
     }
 }
Ejemplo n.º 12
0
        public static MEDICAMENT FindById(string depot)
        {
            //A faire : rechercher un médicament par son nom de dépot
            MEDICAMENT med = null;

            using (var context = new GSB_VisiteEntities())
            {
                //context.Configuration.LazyLoadingEnabled = false;
                var req = from m in context.MEDICAMENT.Include("laFamille")
                          where m.MED_DEPOTLEGAL == depot
                          select m;
                med = req.SingleOrDefault <MEDICAMENT>();
            }
            return(med);
        }
Ejemplo n.º 13
0
        public MEDICAMENT FindById(string depot)
        {
            //rechercher un médicament par son nom de dépot
            MEDICAMENT med = null;

            using (var context = new gsb_visite_groupe3Entities())
            {
                //désactiver le chargement différé
                //context.Configuration.LazyLoadingEnabled = false;
                var req = from m in context.MEDICAMENT.Include("laFamille")
                          where m.MED_DEPOTLEGAL == depot
                          select m;
                med = req.SingleOrDefault <MEDICAMENT>();
            }
            return(med);
        }
Ejemplo n.º 14
0
 public FrmDetailRapport(RAPPORT_VISITE r)
 {
     InitializeComponent();
     this.leRapport = r;
     this.vis       = VisiteurManager.getUnVisiteur(r.RAP_MATRICULE);
     this.lePra     = VisiteurManager.ChargerLePraticien(r.RAP_PRANUM);
     this.mv        = VisiteurManager.chargerLeMotifVisite(r.RAP_MOTIF);
     if (r.RAP_MED1 != null)
     {
         this.med1 = VisiteurManager.ChargerLeMedicament(r.RAP_MED1);
     }
     if (r.RAP_MED2 != null)
     {
         this.med2 = VisiteurManager.ChargerLeMedicament(r.RAP_MED2);
     }
     // Partie design
     this.DoubleBuffered = true;
 }
        private void FrmConsulterMedicament_Load(object sender, EventArgs e)
        {
            List <MEDICAMENT> listMed = VisiteurManager.ChargerMedicaments();

            cbxMedicament.DataSource    = listMed;
            cbxMedicament.DisplayMember = "MED_NOMCOMMERCIAL";
            cbxMedicament.ValueMember   = "MED_DEPOTLEGAL";

            if (leMedoc != null)
            {
                cbxMedicament.SelectedValue = leMedoc.MED_DEPOTLEGAL;
                cbxMedicament.Enabled       = false;
            }
            else
            {
                cbxMedicament.SelectedIndex = -1;
                ucMedicament1.Visible       = false;
                this.leMedoc = null;
            }
        }
Ejemplo n.º 16
0
 private void cbxMedicament_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbxMedicament.SelectedIndex != -1)
     {
         MEDICAMENT m = (MEDICAMENT)cbxMedicament.SelectedItem;
         ucMedicament1.LeMedicament = m;
         ucMedicament1.Visible      = true;
         string idMedicament = m.MED_DEPOTLEGAL;
         List <RAPPORT_VISITE> a;
         a = Manager.ChargerSiRapportsExistentMedicaments(UserId, idMedicament);
         if (a.Count != 0)
         {
             btn_voirRapport.Show();
         }
         else
         {
             btn_voirRapport.Hide();
         }
     }
 }
Ejemplo n.º 17
0
 private void cbxMedicament_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedMedicament         = (MEDICAMENT)cbxMedicament.SelectedItem;
     ucMedicament1.LeMedicament = selectedMedicament;
 }
Ejemplo n.º 18
0
        private void cb_med_SelectedIndexChanged(object sender, EventArgs e)
        {
            MEDICAMENT unMedicament = (MEDICAMENT)this.cb_med.SelectedItem;

            leMedicament = unMedicament;
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Permet de charger un médicament à partir de son nom de dépot légal
        /// </summary>
        /// <param name="depot">chaine caractères</param>
        public static MEDICAMENT ChargerLeMedicament(string depot)
        {
            MEDICAMENT l = MedicamentDAO.FindById(depot);

            return(l);
        }
Ejemplo n.º 20
0
 public FrmDetailMedicament(MEDICAMENT med)
 {
     InitializeComponent();
     this.leMedicament = med;
 }
 public FrmConsulterMedicament(VISITEUR leUtilisateur, MEDICAMENT leMedoc)
 {
     InitializeComponent();
     this.leUtilisateur = leUtilisateur;
     this.leMedoc       = leMedoc;
 }
Ejemplo n.º 22
0
        /// <summary>
        /// Permet de charger un rapport de visite en fonction du medicament
        /// </summary>
        /// <param name="v">Visiteur connecté</param>
        /// <param name="m">Médicament selectionné</param>
        /// <returns>List<RAPPORT_VISITE></returns>
        public static List <RAPPORT_VISITE> ChargerRapportVisiteMedicament(VISITEUR v, MEDICAMENT m)
        {
            List <RAPPORT_VISITE> lrv = null;

            lrv = new RapportVisiteDAO().FindByMedicament(v, m);
            return(lrv);
        }