Ejemplo n.º 1
0
        private void WokerLoadAllData_DoWork(object sender, DoWorkEventArgs e)
        {
            switch (this.currentMode)
            {
            //Card
            case 1:
                Repository.lstAllCards = bus_Card.GetAllCard();
                lstFilterCard          = Repository.lstAllCards;
                this.Dispatcher.Invoke(() =>
                {
                    LoadCard();
                });
                break;

            //Card Holder
            case 2:
                Repository.lstAllCardHolders = bus_CardHolder.GetAllCardHolder();
                lstFilterCardHolder          = Repository.lstAllCardHolders;
                this.Dispatcher.Invoke(() =>
                {
                    LoadHolder();
                });
                break;

            //Device
            case 3:
                Repository.lstAllDevices = bus_Device.GetAllDevice();
                lstFilterDevice          = Repository.lstAllDevices;
                this.Dispatcher.Invoke(() =>
                {
                    LoadDevice();
                });
                break;

            //Door
            case 4:
                Repository.lstAllDoor = bUS_Door.GetAllDoor();
                lstFilterDoor         = Repository.lstAllDoor;
                this.Dispatcher.Invoke(() =>
                {
                    LoadDoor();
                });
                break;

            //Schedule
            case 5:
                Repository.lstAllSchedules = bUS_Schedule.GetAllSchedule();
                lstFilterSchedule          = Repository.lstAllSchedules;
                this.Dispatcher.Invoke(() =>
                {
                    LoadSchedule();
                });
                break;

            //Schedule
            case 6:
                Repository.lstAllRIght = bus_Right.GetAllUserRight();
                lstFilterRight         = Repository.lstAllRIght;
                this.Dispatcher.Invoke(() =>
                {
                    LoadRight();
                });
                break;
            }
        }
Ejemplo n.º 2
0
        private void GetSingleData(string dataType)
        {
            switch (dataType)
            {
            case "CARD":
                Repository.lstAllCards = bus_Card.GetAllCard();
                if (Repository.lstAllCards == null)
                {
                    Repository.lstAllCards = new List <DTO_Card>();
                }
                break;

            case "HOLDER":
                Repository.lstAllCardHolders = bus_CardHolder.GetAllCardHolder();
                if (Repository.lstAllCardHolders == null)
                {
                    Repository.lstAllCardHolders = new List <DTO_CardHolder>();
                }
                break;

            case "DEVICE":
                Repository.lstAllDevices = bus_Device.GetAllDevice();
                if (Repository.lstAllDevices == null)
                {
                    Repository.lstAllDevices = new List <DTO_Device>();
                }
                break;

            case "SCHEDULE":
                Repository.lstAllSchedules = bus_Schedule.GetAllSchedule();
                if (Repository.lstAllSchedules == null)
                {
                    Repository.lstAllSchedules = new List <DTO_Schedule>();
                }
                break;

            case "DOOR":
                Repository.lstAllDoor = bus_Door.GetAllDoor();
                if (Repository.lstAllDoor == null)
                {
                    Repository.lstAllDoor = new List <DTO_Door>();
                }
                break;

            case "DOOR_MODE":
                Repository.lstAllDoorMode = bus_DoorMode.GetAllDoorMode();
                if (Repository.lstAllDoorMode == null)
                {
                    Repository.lstAllDoorMode = new List <DTO_DoorMode>();
                }
                break;

            case "RIGHT":
                Repository.lstAllRIght = bUS_Right.GetAllUserRight();
                if (Repository.lstAllRIght == null)
                {
                    Repository.lstAllRIght = new List <DTO_UserRight>();
                }
                break;

            case "DEPARTMENT":
                Repository.lstAllDepartment = bUS_Department.GetAllDepartment();
                if (Repository.lstAllDepartment == null)
                {
                    Repository.lstAllDepartment = new List <DTO_Department>();
                }
                break;

            case "LOADHOLDERDEPT":
                if (Repository.lstAllCardHolders == null)
                {
                    return;
                }
                foreach (DTO_CardHolder holder in Repository.lstAllCardHolders)
                {
                    holder.Department = bUS_Department.GetDepartmentById(holder.DepartmentId);
                }
                break;

            default:
                break;
            }
        }