Exemplo n.º 1
0
        private void WokerLoadAllData_DoWork(object sender, DoWorkEventArgs e)
        {
            for (int i = 0; i < lstDataType.Count; i++)
            {
                GetSingleData(lstDataType[i]);
                int percentage = (i + 1) * 100 / lstDataType.Count;
                wokerLoadAllData.ReportProgress(percentage);

                this.Dispatcher.Invoke(() =>
                {
                    tbLoadData.Text = string.Format("Đang tải dữ liệu {0}7... {1}%", lstDataType[i], percentage);
                });
            }

            if (this.loginUser.DepartmentId != null)
            {
                this.loginUser.Department = bUS_Department.GetDepartmentById(this.loginUser.DepartmentId);
            }
        }
Exemplo n.º 2
0
        private void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            //Get all selected employees
            List <ListDetailItem> items = lstNonDeptUsers.Where(i => i.IsChecked == true).ToList();

            //Update department of employees(card holder)
            if (items != null && items.Count > 0)
            {
                foreach (ListDetailItem item in items)
                {
                    DTO_CardHolder selectedHOlder = Repository.lstAllCardHolders.FirstOrDefault(u => u.Id == item.Key);
                    if (selectedHOlder != null)
                    {
                        selectedHOlder.DepartmentId = parent.Id;
                        selectedHOlder.Department   = bUS_Department.GetDepartmentById(selectedHOlder.DepartmentId);
                        bus_CardHolder.UpdateCardHolder(selectedHOlder);
                    }
                }
            }
        }
Exemplo n.º 3
0
 private void GetDeptWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     newDepartment = bUS_Department.GetDepartmentById(result.ExtraData);
 }