Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
0
 private void WorkerReloadDept_DoWork(object sender, DoWorkEventArgs e)
 {
     Repository.lstAllDepartment = bUS_Department.GetAllDepartment();
 }
Exemplo n.º 3
0
        private void WorkerReloadDept_DoWork(object sender, DoWorkEventArgs e)
        {
            Repository.lstAllDepartment = bUS_Department.GetAllDepartment();

            MyDepartment[0] = Repository.lstAllDepartment.FirstOrDefault(d => d.Id == MyDepartment[0].Id);
        }