public TypeRooms(string description, double value)
        {
            RolesValidator.New()
            .When(string.IsNullOrEmpty(description), "Descrição inválida")
            .When(value <= 0.00, "Valor inválido")
            .ThrowExceptionIfExists();


            Description = description;
            Value       = value;
        }
示例#2
0
        public Clients(string name, string cPF, string hashs)
        {
            RolesValidator.New()
            .When(string.IsNullOrEmpty(name), "Nome inválido")
            .When(string.IsNullOrEmpty(cPF), "Nome inválido")
            .When(string.IsNullOrEmpty(hashs), "Nome inválido")
            .ThrowExceptionIfExists();

            Name  = name;
            CPF   = cPF;
            Hashs = hashs;
        }
        public Occupations(int dailyAmount, DateTime date, int clientId, int roomId)
        {
            RolesValidator.New()
            .When(dailyAmount <= 0, "Número de diária inválida.")
            .When(clientId <= 0, "Cliente inválido.")
            .When(roomId <= 0, "Quarto inválida.")
            .ThrowExceptionIfExists();

            DailyAmount = dailyAmount;
            Date        = date;
            ClientId    = clientId;
            RoomId      = roomId;
        }
示例#4
0
        public Rooms(int buildingFloor, int roomNum, string situation, int typeRoomId)
        {
            RolesValidator.New()
            .When(buildingFloor <= 0, "Andar inválido")
            .When(roomNum <= 0, "Número do quarto inválido")
            .When(string.IsNullOrEmpty(situation), "Situação inválida")
            .When(typeRoomId <= 0, "Tipo do quarto inválido");


            BuildingFloor = buildingFloor;
            RoomNum       = roomNum;
            Situation     = situation;
            TypeRoomId    = typeRoomId;
        }