Esempio n. 1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            string word = "";
            var    firstSelectedCellContent = this.DgridMedicament.Columns[0].GetCellContent(DgridMedicament.SelectedItem);// выделенное название

            word = ((TextBlock)firstSelectedCellContent).Text;
            dataMedicament dm = new dataMedicament(word);

            dm.Show();
        }
Esempio n. 2
0
        //public Medicament()
        //{
        //    InitializeComponent();


        //    //var transactions = from m in dbContext.MEDICAMENTs

        //    //                   join MR in dbContext.MANUFACTURERs on m.MR_ID equals MR.MR_ID
        //    //                   join MS in dbContext.MEDICAMENT_has_SYMPTOMS on m.M_ID equals MS.M_ID
        //    //                   join s in dbContext.MEDICAMENT_has_SYMPTOMS on MS.S_ID equals s.S_ID
        //    //                   join d in dbContext.MEDICATIONs on s.S_ID equals d.S_ID
        //    //                   join med in dbContext.MEDICATIONs on s.S_ID equals med.D_ID
        //    //                   //where word.ToUpper() == m.M_NAME.ToUpper() || word.ToUpper() == s.SYMPTOM.S_NAME
        //    //                   select new
        //    //                   {
        //    //                       Name = m.M_NAME,
        //    //                       Composition = m.M_COMPOSITION,

        //    //                       MethodUse = m.M_METHOD_USE_DOSAGE,
        //    //                       o = s.SYMPTOM.S_NAME,
        //    //                       disease = d.DISEASE.NAME,
        //    //                       MR = MR.NAME,
        //    //                       sym = s.SYMPTOM.S_NAME
        //    //                   };


        //    //foreach (var item in transactions.Distinct())
        //    //{
        //    //    DgridMedicament.Items.Add(item);
        //    //}



        //}


        private void AddBtn_Click(object sender, RoutedEventArgs e)
        {
            var firstSelectedCellContent = this.DgridMedicament.Columns[0].GetCellContent(DgridMedicament.SelectedItem);
            var firstSelectedCell        = firstSelectedCellContent != null ? firstSelectedCellContent.Parent : null;

            //MessageBox.Show(firstSelectedCell.ToString());
            word = ((TextBlock)firstSelectedCellContent).Text;
            dataMedicament dm = new dataMedicament(word);

            dm.Show();
        }