Ejemplo n.º 1
0
        public static Workers GetUser(int userID, string password)
        {
            var worker = WorkerDataBase.getWorker(userID, password, "Employee_Status");

            GarageModels.Workers workersDTO = new GarageModels.Workers()
            {
                User = new GarageModels.User
                {
                    first_name        = worker.User.first_name,
                    last_name         = worker.User.last_name,
                    tel_number        = worker.User.tel_number,
                    address           = worker.User.address,
                    password          = worker.User.password,
                    mail_address      = worker.User.mail_address,
                    registertion_date = DateTime.Now
                },


                num_of_credits = worker.num_of_credits ?? 0,

                employee_code = new GarageModels.Employee_kind()
                {
                    description_of_the_kind = worker.Employee_kind.description_of_the_kind,
                    employee_kind_code      = worker.Employee_kind.employee_kind_code
                }
            };

            return(workersDTO);
        }
Ejemplo n.º 2
0
        public static Workers getWorkerByID(int id)
        {
            var worker = WorkerDataBase.getWorkerByID(id, "Employee_Status");

            GarageModels.Workers workersDTO = new GarageModels.Workers()
            {
                User = new GarageModels.User()
                {
                    first_name = worker.User.first_name,
                    last_name  = worker.User.last_name,
                    tel_number = worker.User.tel_number,
                    address    = worker.User.address
                },
                id_worker      = worker.id_worker,
                num_of_credits = worker.num_of_credits ?? 0,
                password       = worker.User.password,
                employee_code  = new GarageModels.Employee_kind()
                {
                    description_of_the_kind = worker.Employee_kind.description_of_the_kind,
                    employee_kind_code      = worker.Employee_kind.employee_kind_code
                }
            };

            return(workersDTO);
        }