public MainWindow()
 {
     InitializeComponent();
     _context      = new ViewModels.CoreViewModel(typeof(LoginForm));
     DataContext   = _context;
     this.Closing += SaveCurrentState;
 }
예제 #2
0
 public void PopulateCoreDetails(ViewModels.CoreViewModel model, IDbConnection conn = null)
 {
     if (model.CreatedBy != null)
     {
         if (model.CreatedBy.PId.HasValue)
         {
             model.CreatedBy = GetUser(model.CreatedBy.PId.Value, conn);
         }
         else
         {
             model.CreatedBy = null;
         }
     }
     if (model.ModifiedBy != null)
     {
         if (model.ModifiedBy.PId.HasValue)
         {
             model.ModifiedBy = GetUser(model.ModifiedBy.PId.Value, conn);
         }
         else
         {
             model.ModifiedBy = null;
         }
     }
     if (model.DisabledBy != null)
     {
         if (model.DisabledBy.PId.HasValue)
         {
             model.DisabledBy = GetUser(model.DisabledBy.PId.Value, conn);
         }
         else
         {
             model.DisabledBy = null;
         }
     }
 }