예제 #1
0
 public OrderTypeEditWindowViewModel(OrderTypesTabViewModel orderTypeTabViewModel,
     OrderTypeEditWindow orderTypeEditWindow, OrderType orderType)
     : base(orderTypeTabViewModel, orderTypeEditWindow, orderType)
 {
     using (var con = new BaudiDbContext())
     {
         SpecializationList = con.Specializations.ToList();
         if (Update)
         {
             OrderType = con.OrderTypes.Find(orderType.OrderTypeID);
             OrderType.Specializations.ForEach(s => s.IsSelected = true);
         }
         else
         {
             OrderType = new OrderType();
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="orderTypesTabViewModel">Order types tab view model</param>
 /// <param name="orderType">Order type</param>
 public OrderTypeEditWindow(OrderTypesTabViewModel orderTypesTabViewModel, OrderType orderType)
 {
     InitializeComponent();
     DataContext = new OrderTypeEditWindowViewModel(orderTypesTabViewModel, this, orderType);
 }