1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using BL;
namespace UI.Visit
{
/// <summary>
/// Logique d'interaction pour VisitWindow.xaml
/// </summary>
public partial class VisitWindow : Window
{
private BE.Visit m_visit = new BE.Visit();
public BE.Visit Visit
{
get { return m_visit; }
set { m_visit = value; }
}
private BL.BL_Class m_BL;
public BL.BL_Class BL
{
get { return m_BL; }
set { m_BL = value; }
}
public bool Save { get; set; }
public VisitWindow(BL_Class B)
{
InitializeComponent();
Save = false;
BL = B;
}
private void Save_Click(object sender, RoutedEventArgs e)
{
Save = true;
this.Close();
}
private void Cancel_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.DataContext = this;
}
private void Click_AddMedicine(object sender, RoutedEventArgs e)
{
if (!(Visit.Medicines.Exists(m => m.Code == BL.lstMedicines[listMedicines.SelectedIndex].Code)))
{
Visit.Medicines.Add(BL.lstMedicines[listMedicines.SelectedIndex]);
}
}
private void Click_RemoveMedicine(object sender, RoutedEventArgs e)
{
if (Medicines.SelectedIndex != -1)
Visit.Medicines.RemoveAt(Medicines.SelectedIndex);
}
}
} |