private void InitData() { bUS_Door = new BUS_Door(); cbMode.ItemsSource = Repository.lstAllDoorMode; cbMode.DisplayMemberPath = "Name"; cbMode.SelectedValuePath = "Id"; myDoorWorker = new BackgroundWorker(); myDoorWorker.WorkerSupportsCancellation = true; myDoorWorker.DoWork += MyDoorWorker_DoWork; myDoorWorker.RunWorkerCompleted += MyDoorWorker_RunWorkerCompleted; getDoorWorker = new BackgroundWorker(); getDoorWorker.WorkerSupportsCancellation = true; getDoorWorker.DoWork += GetDoorWorker_DoWork; getDoorWorker.RunWorkerCompleted += GetDoorWorker_RunWorkerCompleted; delDoorWorker = new BackgroundWorker(); delDoorWorker.WorkerSupportsCancellation = true; delDoorWorker.DoWork += DelDoorWorker_DoWork; delDoorWorker.RunWorkerCompleted += DelDoorWorker_RunWorkerCompleted; if (this.mode == EType.WindowMode.ADD_MODE) { btDelete.IsEnabled = false; } else { btDelete.IsEnabled = true; } }
public LaunchWindow(DTO_CardHolder loginUser) { InitializeComponent(); this.loginUser = loginUser; bus_Card = new BUS_Card(); bus_CardHolder = new BUS_CardHolder(); bus_Device = new BUS_Device(); bus_Schedule = new BUS_Schedule(); bus_Door = new BUS_Door(); bus_DoorMode = new BUS_DoorMode(); bUS_Right = new BUS_Right(); bUS_Department = new BUS_Department(); lstDataType = new List <string>() { "CARD", "HOLDER", "DEVICE", "SCHEDULE", "DOOR", "DOOR_MODE", "RIGHT", "DEPARTMENT", "LOADHOLDERDEPT" }; wokerLoadAllData = new BackgroundWorker(); wokerLoadAllData.WorkerReportsProgress = true; wokerLoadAllData.DoWork += WokerLoadAllData_DoWork; wokerLoadAllData.ProgressChanged += WokerLoadAllData_ProgressChanged; wokerLoadAllData.RunWorkerCompleted += WokerLoadAllData_RunWorkerCompleted; wokerLoadAllData.RunWorkerAsync(); }
public MainWindow() { InitializeComponent(); bus_Card = new BUS_Card(); bus_CardHolder = new BUS_CardHolder(); bus_Device = new BUS_Device(); bUS_DeviceSocket = new BUS_DeviceSocket(); bUS_Schedule = new BUS_Schedule(); bUS_Door = new BUS_Door(); bus_Right = new BUS_Right(); lstFilterCard = new List <DTO_Card>(); lstFilterDepartment = new List <DTO_Department>(); lstFilterDevice = new List <DTO_Device>(); lstFilterDoor = new List <DTO_Door>(); lstFilterSchedule = new List <DTO_Schedule>(); lstFilterRight = new List <DTO_UserRight>(); this.DataContext = this; }